Inheritance: MonoBehaviour
Exemple #1
0
        /// <summary>
        /// Initialize the controller.
        /// </summary>
        /// <param name="firstRun">Whether it is the first time that CmisSync is being run.</param>
        public virtual void Initialize(Boolean firstRun)
        {
            this.firstRun = firstRun;

            // Create the CmisSync folder and add it to the bookmarks
            bool syncFolderCreated = CreateCmisSyncFolder();

            if (syncFolderCreated)
            {
                //Dont add bookmark for Oris4
                AddToBookmarks();
            }

            if (firstRun)
            {
                ConfigManager.CurrentConfig.Notifications = true;
            }

            folderLock = new FolderLock(FoldersPath);

            autoUpdater = new Sparkle("http://update.oris4.com/versioninfo.xml")
            {
                //ShowDiagnosticWindow = true,
                //EnableSystemProfiling = true,
                //SystemProfileUrl = new Uri("http://update.oris4.com/profile.html"),
            };

            autoUpdater.StartLoop(true, true);
        }
Exemple #2
0
        private void AddSummonDeathSparkles(Vector2 summonPosition)
        {
            for (var i = 0; i < 20; i++)
            {
                var lifespan            = 32;
                var initialSoulPosition = this.soulPosition;
                var randomAngle         = random.NextDouble() * 2 * Math.PI;
                var circleX             = Math.Cos(randomAngle);
                var circleY             = Math.Sin(randomAngle);
                var burstSpeed          = Random.NextDouble() * 3 + 2;
                var pos      = new Point((int)summonPosition.X, (int)summonPosition.Y);
                var velocity = new Vector2((float)(burstSpeed * circleX), (float)(burstSpeed * circleY));
                var movement = new Action <Sparkle>(s =>
                {
                    var progress       = (float)s.RemainingLife / s.Lifespan;
                    var burstVelocity  = Vector2.Multiply(velocity, (float)Math.Cos(progress * Math.PI));
                    var toSoulVelocity = new Vector2(0.1f * progress * (initialSoulPosition.X - s.Position.X), 0.1f * progress * (initialSoulPosition.Y - s.Position.Y));
                    var finalVelocity  = burstVelocity + toSoulVelocity;

                    s.Position = new Point(s.Position.X + (int)Math.Round(finalVelocity.X), s.Position.Y + (int)Math.Round(finalVelocity.Y));
                });
                var newSparkle = new Sparkle {
                    Lifespan = lifespan, RemainingLife = lifespan, Position = pos, Movement = movement
                };
                this.sparkles[this.sparkles.FirstOrDefault(kvp => !this.sparkles.ContainsKey(kvp.Key + 1)).Key + 1] = newSparkle;
            }
        }
Exemple #3
0
        public ApplicationContainer()
        {
            var builder = new ContainerBuilder();

            //builder.RegisterModule<WhiteboxProfilingModule>();

            //default to InstancePerDependency, i.e., they it will make a new
            //one each time someone asks for one
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly());

            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
            .Where(t => t.GetInterfaces().Contains(typeof(ICommand))).InstancePerLifetimeScope();

            builder.Register <Sparkle>(c =>
            {
                var s = new Sparkle(@"http://build.palaso.org/guestAuth/repository/download/bt78/.lastSuccessful/appcast.xml", Resources.Bloom);
                s.CustomInstallerArguments = "/qb";
                s.DoLaunchAfterUpdate      = false;
                return(s);
            }).InstancePerLifetimeScope();

            builder.Register(c => LocalizationManager).SingleInstance();

            if (Settings.Default.MruProjects == null)
            {
                Settings.Default.MruProjects = new MostRecentPathsList();
            }
            builder.RegisterInstance(Settings.Default.MruProjects).SingleInstance();

            _container = builder.Build();
        }
Exemple #4
0
        public NetSparkleUpdateWindow(AppCastItem[] items, Sparkle sparkle)
        {
            InitializeComponent();

            _items = items;
            _updateAvailableLabel.Text = $"Version {items[0].Version} of EasyConnect is available, you have version {items[0].AppVersionInstalled}.  Would you like to update?";

            WebClient webClient    = new WebClient();
            string    releaseNotes = "";

            foreach (AppCastItem item in items)
            {
                string currentReleaseNotes = webClient.DownloadString(item.ReleaseNotesLink);
                currentReleaseNotes = currentReleaseNotes.Substring(currentReleaseNotes.IndexOf("<body>") + 6);
                currentReleaseNotes = currentReleaseNotes.Substring(0, currentReleaseNotes.IndexOf("</body>"));
                currentReleaseNotes = currentReleaseNotes.Replace("<h3>Change log</h3>", "<h3>" + item.Version + "</h3>");

                releaseNotes += currentReleaseNotes;
            }

            releaseNotes = "<html><body style=\"font-family: 'Segoe UI', 'sans-serif'; font-size: 10pt\">" + releaseNotes + "</body></html>";

            _changeLogText.Invoke((MethodInvoker) delegate
            {
                _changeLogText.Navigate("about:blank");
                _changeLogText.Document.OpenNew(true);
                _changeLogText.Document.Write(releaseNotes);
                _changeLogText.DocumentText = releaseNotes;
            });

            EnsureDialogShown();
        }
        public KryptonSparkleDownloadProgress(Sparkle sparkle, KryptonSparkleAppCastItem item, Image applicationIcon, Icon icon, bool unattended)
        {
            InitializeComponent();

            if (applicationIcon != null)
            {
                pbxAppIcon.Image = applicationIcon;
            }

            if (icon != null)
            {
                Icon = icon;
            }

            // store the item
            _sparkle = sparkle;
            _item    = item;
            //_referencedAssembly = referencedAssembly;
            _unattend = unattended;

            // init ui
            kbtnInstall.Visible      = false;
            klblHeader.Text          = $"Downloading: { item.AppName }, { item.Version }";
            progressDownload.Maximum = 100;
            progressDownload.Minimum = 0;
            progressDownload.Step    = 1;

            // show the right
            Size = new Size(Size.Width, 107);
            klblSecurityHint.Visible = false;
        }
        public NetSparkleCheckerWaitUI()
        {
            // init ui
            InitializeComponent();

            // get cmdline args
            String[] args = Environment.GetCommandLineArgs();

#if DEBUG
            // enable dialog
            Boolean bShowDiagnosticWindow = true;
#else
            // disable dialog
            Boolean bShowDiagnosticWindow = false;
#endif
            // init sparkle
            _sparkle = new Sparkle(args[2], args[1], bShowDiagnosticWindow);

            // set labels
            lblRefFileName.Text = args[1];
            lblRefUrl.Text      = args[2];

            if (_sparkle.ApplicationIcon != null)
            {
                imgAppIcon.Image = _sparkle.ApplicationIcon;
            }

            if (_sparkle.ApplicationWindowIcon != null)
            {
                Icon = _sparkle.ApplicationWindowIcon;
            }

            bckWorker.RunWorkerAsync();
        }
Exemple #7
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            Init();

#if !APPX
            if (_sparkle == null && ConfigurationManager.AppSettings["checkForUpdates"] != "false")
            {
                _sparkle = new Sparkle(
                    String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                                ? "https://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                                : ConfigurationManager.AppSettings["appCastUrl"],
                    Icon,
                    SecurityMode.Strict,
                    "<DSAKeyValue><P>12ewCqvTWhA9MrRLFDyvohdnbTaNkktQCzu87Tolcs7pOQcwsA0wnZF5Tkp2m21H0Y4N5vILPttmXizYLUZUSndLRfJlBtKWJi45CrUVZaMsEgYECXNrxuPGt9U9guPX39xdn1wwB/8TZRmAzqVSyDnrNw6e+2Ln9EJUG6RwmVc=</P><Q>ydyEMyIgVPSHlJvv5pcp+/DE8wU=</Q><G>It/uZNoAH//7ZQDmcjMNtInYRQ4MJBAp3posEglTlsWHb/BcKLqDkd4R0FkL6T+ZCu8DeC7TK4bPiecWDPY9E3MRmtivCxJVGD3LPv1eTsuRl+MyOg4z6KsbPTtXFjnDdG1+0zm3hzKntzgHiY6OaHwJaYlyLMmlFoNePUo4zN4=</G><Y>J3eg75iIHjUqklOn/CUOR9FALbSz4LFiswBbQBAertYwWbjLvKnr85hMTLgoFKMW+s5PHJaTBSAMmZS4rLj01Rver12JcoXs9t/mwuJYSw6QNwIO1Oau1OXF4dqA8fOH/XCGGcRzMdLt8FxtzRTuU5H88afsg5yjui54ezg6c3U=</Y></DSAKeyValue>");

                _sparkle.UIFactory         = new NetSparkleUIFactory();
                _sparkle.CloseApplication += _sparkle_CloseApplication;

                _sparkle.StartLoop(
                    true,
                    true,
                    String.IsNullOrEmpty(ConfigurationManager.AppSettings["updateCheckMinutes"])
                                                ? TimeSpan.FromMinutes(60 * 24)
                                                : TimeSpan.FromMinutes(Convert.ToInt32(ConfigurationManager.AppSettings["updateCheckMinutes"])));
            }
#endif
        }
Exemple #8
0
        private void Initialize()
        {
            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkle = new Sparkle($"{UpdateUrl}/NetSparkle/appcast.xml", icon, SecurityMode.Unsafe);
        }
        public AutoUpdate(bool forceUpgrade)
        {
            m_autoUpdator = new Sparkle(UpdateURL);
            //m_autoUpdator.ApplicationIcon = Resources.software_update_available;
            //m_autoUpdator.ApplicationWindowIcon = Resources.UpdateAvailable;

            this.forceUpgrade = forceUpgrade;
        }
Exemple #10
0
        public Form1()
        {
            InitializeComponent();

            var appcastUrl = "file://" + DirectoryOfTheApplicationExecutable + "../../../../Extras/Sample Appcast.xml";

            _sparkleUpdateDetector = new Sparkle(appcastUrl, SystemIcons.Application);
            _sparkleUpdateDetector.CheckOnFirstApplicationIdle();
        }
        /// <summary>
        /// Start doing whatever is needed for the supported type of action.
        /// </summary>
        public void StartWorking(Dictionary <string, string> commandLineArgs)
        {
#if !MONO
            using (var sparkle = new Sparkle(@"http://downloads.palaso.org/FlexBridge/Alpha/appcast.xml", CommonResources.chorus32x32))
            {
                sparkle.DoLaunchAfterUpdate = false;
                sparkle.CheckForUpdatesAtUserRequest();
            }
#endif
        }
Exemple #12
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            this.TbUserName.Focus();
            var updateUrl = ConfigurationManager.AppSettings["api"];

            //自动升级
            System.Drawing.Icon icon =
                System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetExecutingAssembly().Location);
            _sparkle = new Sparkle(updateUrl + "/Installer/versioninfo.xml", icon);
            _sparkle.StartLoop(true, true, TimeSpan.FromHours(3));
        }
Exemple #13
0
        /// <summary>
        /// Secondary MainForm initialisation.
        /// </summary>
        public void Initialise()
        {
            Application.AddMessageFilter(this);

            bool useBeta = Preferences.StandardPreferences.UseBeta;

            _sparkle = new Sparkle(useBeta ? Constants.BetaAppCastURL : Constants.AppCastURL);
            _sparkle.installAndRelaunch += _sparkle_installAndRelaunch;

            _sparkle.StartLoop(true);
        }
        public Shell()
        {
            InitializeComponent();

            Application.AddMessageFilter(this);

            _sparkle = new Sparkle(Settings.Default.VersionInfoUri);
            _sparkle.ApplicationIcon       = Properties.Resources.r4dio_app.ToBitmap();
            _sparkle.ApplicationWindowIcon = Properties.Resources.r4dio_app;
            _sparkle.StartLoop(true, true);
        }
Exemple #15
0
        public void AutoUpdate()
        {
            string  assembly = Path.GetFileName(Assembly.GetExecutingAssembly().Location);
            Sparkle sparkle  = new Sparkle(AppcastUrl, null, NetSparkle.Enums.SecurityMode.UseIfPossible, DSAPublicKey, assembly);

            sparkle.CloseApplication += (() =>
            {
                AcadApp.DocumentManager.MdiActiveDocument.SendStringToExecute("quit ", true, false, true);
            });

            sparkle.CheckForUpdatesAtUserRequest();
        }
Exemple #16
0
        public Form1()
        {
            InitializeComponent();

            var appcastUrl = "https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml";
            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkleUpdateDetector = new Sparkle(appcastUrl, icon);
            _sparkleUpdateDetector.CheckOnFirstApplicationIdle();
            _sparkleUpdateDetector.CloseApplication += _sparkleUpdateDetector_CloseApplication;
        }
Exemple #17
0
 public MainWindow()
 {
     InitializeComponent();
     sparkle = new Sparkle(
         "https://rydavidson.github.io/meta/Accela/AAChangeDBConfig/appcast.xml",
         GetWindowIcon(),
         SecurityMode.Strict
         );
     Loaded += RunOnLoad;
     debug   = new DebugConsole(this);
     //log4net.Config.XmlConfigurator.Configure();
     logger.Info("Application startup");
 }
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
Exemple #19
0
        private void UpdateSparkles()
        {
            mNextSparkleDuration--;
            if (mNextSparkleDuration <= 0)
            {
                mNextSparkleDuration = 12;
                mSparkleOffsetIndex  = (mSparkleOffsetIndex + 1) % 8;

                Sparkle sparkleObject = new Sparkle(Game, Level);
                sparkleObject.DisplacementX = DisplacementX + SparkleOffsets[mSparkleOffsetIndex * 2];
                sparkleObject.DisplacementY = DisplacementY + SparkleOffsets[mSparkleOffsetIndex * 2 + 1];
                Level.Objects.Add(sparkleObject);
            }
        }
        public override void PerformFrame(BCBlockGameState gamestate, Paddle pPaddle)
        {
            var rg = BCBlockGameState.rgen;
            base.PerformFrame(gamestate, pPaddle);
            useoverlaybrush = new SolidBrush(new HSLColor(rg.NextDouble()*240, 240f, 120f));
            //spawn a sparkle.
            var paddlerect = pPaddle.Getrect();
            PointF randompoint = new PointF(paddlerect.Left + (float) (paddlerect.Width*rg.NextDouble()),
                                            paddlerect.Top + (float) (paddlerect.Height*rg.NextDouble()));

            Sparkle s = new Sparkle(randompoint, BCBlockGameState.GetRandomVelocity(0, 2),
                                    new HSLColor(rg.NextDouble()*240, 240, 120));
            gamestate.NextFrameCalls.Enqueue(new BCBlockGameState.NextFrameStartup(() => gamestate.Particles.Add(s)));
        }
Exemple #21
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public MainForm()
        {
            InitializeComponent();
            Init();

            _sparkle = new Sparkle(
                String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                        ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                        : ConfigurationManager.AppSettings["appCastUrl"]);
            _sparkle.ApplicationWindowIcon = Icon;
            _sparkle.ApplicationIcon       = Icon.ToBitmap();

            _sparkle.StartLoop(true, true);
        }
Exemple #22
0
        /// <summary>
        /// Initiates an update check for the application.
        /// </summary>
        /// <returns>True if the update process was started successfully, false otherwise.</returns>
        public void CheckForUpdate()
        {
            _sparkle.StopLoop();

            _sparkle = new Sparkle(
                String.IsNullOrEmpty(ConfigurationManager.AppSettings["appCastUrl"])
                                        ? "http://lstratman.github.io/EasyConnect/updates/EasyConnect.xml"
                                        : ConfigurationManager.AppSettings["appCastUrl"]);
            _sparkle.ApplicationWindowIcon = Icon;
            _sparkle.ApplicationIcon       = Icon.ToBitmap();
            _sparkle.checkLoopFinished    += _sparkle_checkLoopFinished;

            _sparkle.StartLoop(true, true);
        }
Exemple #23
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("http://update.applimit.com/netsparkle/versioninfo.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
Exemple #24
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application);
            // TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
            _sparkle.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
Exemple #25
0
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("http://update.applimit.com/netsparkle/versioninfo.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
        public ApplicationContainer()
        {
            var builder = new ContainerBuilder();

            //builder.RegisterModule<WhiteboxProfilingModule>();

            //default to InstancePerDependency, i.e., they it will make a new
            //one each time someone asks for one
            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly());

            builder.RegisterAssemblyTypes(Assembly.GetExecutingAssembly())
            .Where(t => t.GetInterfaces().Contains(typeof(ICommand))).InstancePerLifetimeScope();

            builder.Register <Sparkle>(c =>
            {
                string url;
                try
                {
                    var updateTable = new UpdateVersionTable();
                    url             = updateTable.GetAppcastUrl();
                }
                catch (Exception)
                {
                    url = "";
                    Logger.WriteEvent("Could not retrieve UpdateVersionTable from the internet");
                }
                var s = new Sparkle(url, Resources.Bloom);
                s.CustomInstallerArguments = "/qb";
                s.DoLaunchAfterUpdate      = false;
                return(s);
            }).InstancePerLifetimeScope();


            builder.Register(c => LocalizationManager).SingleInstance();

            if (Settings.Default.MruProjects == null)
            {
                Settings.Default.MruProjects = new MostRecentPathsList();
            }
            builder.RegisterInstance(Settings.Default.MruProjects).SingleInstance();

            //this is to prevent some problems we were getting while waiting for a browser to navigate and being forced to call Application.DoEvents().
            //HtmlThumbnailer & ConfigurationDialog, at least, use this.
            builder.Register(c => new NavigationIsolator()).InstancePerLifetimeScope();

            builder.Register <HtmlThumbNailer>(c => new HtmlThumbNailer(c.Resolve <NavigationIsolator>())).SingleInstance();

            _container = builder.Build();
        }
Exemple #27
0
        private void OnLoaded(object sender, RoutedEventArgs e)
        {
            _sparkleUpdater = new Sparkle(
                Helpers.Resource.Get <string>("BRAND_SPARKLE_URL"),
                System.Drawing.Icon.ExtractAssociatedIcon(Assembly.GetEntryAssembly().Location),
                SecurityMode.Unsafe)
            {
                ShowsUIOnMainThread = true,
                RelaunchAfterUpdate = true,
                UIFactory           = new SparkleUIFactory()
            };

            _sparkleUpdater.StartLoop(true, true, TimeSpan.FromHours(2));
            Loaded -= OnLoaded;
        }
Exemple #28
0
        public Form1()
        {
            InitializeComponent();

            var appcastUrl = "https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml";
            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkleUpdateDetector = new Sparkle(appcastUrl, icon);
            // TLS 1.2 required by GitHub (https://developer.github.com/changes/2018-02-01-weak-crypto-removal-notice/)
            _sparkleUpdateDetector.SecurityProtocolType = System.Net.SecurityProtocolType.Tls12;
            _sparkleUpdateDetector.CheckOnFirstApplicationIdle();
            _sparkleUpdateDetector.CloseApplication += _sparkleUpdateDetector_CloseApplication;
        }
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application); //, "NetSparkleTestApp.exe");
            _sparkle.RunningFromWPF = true;
            _sparkle.StartLoop(true, true);
        }
Exemple #30
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", SystemIcons.Application)
            {
                TrustEverySSLConnection = true,
            };

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
Exemple #31
0
        public override void Updata()
        {
            if (!this.stageInitialized)
            {
                this.InitializeStage();
            }

            if (this.stageInitialized)
            {
                this.UpdateStage(this.stage);
            }

            this.CheckSpecialTriggers();

            this.waittime++;

            foreach (var kvp in this.sparkles)
            {
                kvp.Value.RemainingLife -= 1;
            }

            var expiredSparkles = this.sparkles.Where(kvp => kvp.Value.RemainingLife <= 0).ToArray();

            foreach (var expired in expiredSparkles)
            {
                this.sparkles.Remove(expired);
            }

            foreach (var kvp in this.sparkles)
            {
                kvp.Value.Movement?.Invoke(kvp.Value);
            }

            if (this.waittime % 8 == 0)
            {
                var lifespan    = 36;
                var randomDist  = Random.NextDouble() * 5 + 8;
                var randomAngle = random.NextDouble() * 2 * Math.PI;
                var pos         = new Point((int)this.soulPosition.X + (int)(randomDist * Math.Cos(randomAngle)), (int)this.soulPosition.Y + (int)(randomDist * Math.Sin(randomAngle)));

                var newSparkle = new Sparkle {
                    Lifespan = lifespan, RemainingLife = lifespan, Position = pos, Movement = null
                };
                this.sparkles[this.sparkles.FirstOrDefault(kvp => !this.sparkles.ContainsKey(kvp.Key + 1)).Key + 1] = newSparkle;
            }
        }
Exemple #32
0
        public Form1()
        {
            InitializeComponent();

            _sparkle = new Sparkle("https://update.applimit.com/netsparkle/versioninfo.xml")
            {
                ShowDiagnosticWindow    = true,
                TrustEverySSLConnection = true,
                //EnableSystemProfiling = true,
                //SystemProfileUrl = new Uri("http://update.applimit.com/netsparkle/stat/profileInfo.php")
            };

            _sparkle.UpdateDetected += new UpdateDetected(_sparkle_updateDetected);
            //_sparkle.EnableSilentMode = true;
            //_sparkle.HideReleaseNotes = true;

            _sparkle.StartLoop(true);
        }
        public MainWindow()
        {
            InitializeComponent();

            // remove the netsparkle key from registry
            try
            {
                Microsoft.Win32.Registry.CurrentUser.DeleteSubKeyTree("Software\\Microsoft\\NetSparkle.TestAppWPF");
            }
            catch { }

            // set icon in project properties!
            string manifestModuleName = System.Reflection.Assembly.GetEntryAssembly().ManifestModule.FullyQualifiedName;
            var    icon = System.Drawing.Icon.ExtractAssociatedIcon(manifestModuleName);

            _sparkle = new Sparkle("https://deadpikle.github.io/NetSparkle/files/sample-app/appcast.xml", icon); //, "NetSparkleTestApp.exe");
            _sparkle.StartLoop(true, true);
        }
        public override bool Powerup_PerformFrame(BCBlockGameState gamestate)
        {
            Random rg = BCBlockGameState.rgen;
            Color usecolor = new HSLColor(BCBlockGameState.rgen.NextDouble() * 240, 240, 120);
            //select a random position.
            RectangleF baserect = GetRectangleF();
            PointF randompos = new PointF(baserect.Left + (float)(baserect.Width * rg.NextDouble()), baserect.Top + (float)(baserect.Height * rg.NextDouble()));

            PointF RandomVelocity = new PointF((float)rg.NextDouble() * 0.5f - 0.25f, (float)rg.NextDouble() * 0.5f - 0.25f);

            Sparkle sp = new Sparkle(randompos, RandomVelocity, usecolor);
            sp.MaxRadius = (float)(1 + rg.NextDouble() * 4);
            gamestate.Particles.Add(sp);

            return false;
        }
        public override bool AbilityFrame(GameCharacter gamechar, BCBlockGameState gstatem)
        {
            delayvalue++;
            if (delayvalue == delayfactor)
            {
                usetheseattributes = BCBlockGameState.Choose(useDrawAttributes);
                delayvalue = 0;
            }
            //also spawn a sparkly. One sparkley per frame.
            //choose a random colour...
            Random rg = BCBlockGameState.rgen;
            Color usecolor = new HSLColor(BCBlockGameState.rgen.NextDouble()*240, 240, 120);
            //select a random position.
            RectangleF baserect = gamechar.GetRectangleF();
            PointF randompos = new PointF(baserect.Left + (float)(baserect.Width * rg.NextDouble()), baserect.Top + (float)(baserect.Height * rg.NextDouble()));

            PointF RandomVelocity = new PointF((float)rg.NextDouble()*0.5f-0.25f,(float)rg.NextDouble()*0.5f-0.25f);

            Sparkle sp = new Sparkle(randompos, RandomVelocity, usecolor);
            sp.MaxRadius = 5;
            gstatem.Particles.Add(sp);

            return base.AbilityFrame(gamechar, gstatem);
        }