public override bool OnStart()
 {
     RoleEnvironment.StatusCheck += RoleEnvironment_StatusCheck;
     var connString = CloudConfigurationManager.GetSetting(Constants.SETTING_STORAGE_CONNECTION_STRING);
     this._updater = new UpdaterFromBlob(connString);
     return base.OnStart();
 }
        public void NotifyNewVersion(IUpdater updater)
        {
            if (this.InvokeRequired)
            {
                this.Invoke(new NotifyNewVersionDelegate(NotifyNewVersion), new object[] { updater });
            }
            else
            {
                if (Program.Context.IsNeededToNotifyNewVersion)
                {
                    s.LastestVersionInformed = Program.Context.LatestVersion;

                    lnkDownloadUpdate.Visible = true;

                    if (MessageBox.Show(this, Program.Name + "가 새 " + Program.Context.LatestVersion + " 버전으로 업데이트되었습니다.\r\n\r\n지금 업데이트 하시겠습니까?", Program.Name, MessageBoxButtons.YesNo, MessageBoxIcon.Question)
                        == System.Windows.Forms.DialogResult.Yes)
                    {
                        try
                        {
                            WorkingUI.SetParent(this);
                            updater.UpdateAsync(false);
                        }
                        catch
                        {
                        }
                    }
                    else
                    {
                        updaterDelayed = updater;
                    }
                }
            }
        }
 protected ConstrainedAxis(string name, IUpdater<float> deadzone, IUpdater<float> scale, AxisBinding binding)
     : this(name)
 {
     mDeadzone = deadzone;
     mScale = scale;
     mBinding = binding;
 }
 public UpdaterModuleBootstraper(IUpdater updater, RegionManager regionManager,IEventAggregator eventAggregator)
 {
     // use injected services from Nomad, instead of using IServiceLocator mechanism
     _updater = updater;
     _regionManager = regionManager;
     _eventAggregator = eventAggregator;
 }
        public UpdateService(IUpdater updater)
        {
            this.updater = updater;

            this.updater.AppCastUrl = Constants.UpdateUrl;
            this.updater.ShowDiagnosticWindow = true;
            this.updater.TrustEverySSLConnection = true;
        }
Beispiel #6
0
        public Planet(Drawable drawable,
		  bool stars, double starfraction, double starcolour,
		  bool clouds, Random random, 
		  double icelevel, double glaciers,
		  double fracdim, 
		  bool hourspec, double hourangle,
		  bool inclspec, double inclangle,
		  double powscale, IUpdater updater)
        {
            _starfraction = starfraction;
              _starcolour = starcolour;
              _icelevel = icelevel;
              _glaciers = glaciers;
              _random = random;
              _hourspec = hourspec;
              _inclspec = inclspec;
              _hourangle = hourangle;
              _inclangle = inclangle;

              _starFactory = new StarFactory(_random, _starfraction, _starcolour);

              if (stars)
            {
              updater.Update((c) => _starFactory.Generate());
            }
              else
            {
              var spectrum = new SpectralSynthesis(random);
              var a = spectrum.Synthesize(meshsize, 3.0 - fracdim);

              var mesh = new Mesh(a, meshsize);

              // Apply power law scaling if non-unity scale is requested.
              if (powscale != 1.0)
            {
              mesh.ApplyPowerLawScaling(powscale);
            }

              mesh.AutoScale();

              var cp = CalculateIntensities(mesh, meshsize);

              var dimensions = drawable.Dimensions;
              var info = new RenderInfo(dimensions.Width, dimensions.Height, meshsize,
                    cp);
              if (clouds)
            {
              updater.Update((c) => DoRenderClouds(c, info));
            }
              else
            {
              int width = dimensions.Width;
              int height = dimensions.Height;
              var sunvec = IncidentLightDirectionVector();
              updater.Update((c) => DoRenderPlanet(c, width, height, info, sunvec));
            }
            }
        }
Beispiel #7
0
 public void Run(IUpdater RootUpdater, IDrawer RootDrawer)
 {
     using (var game = new XnaGame(Initializer))
     {
         XnaGame = game;
         game.RootUpdater = RootUpdater;
         game.RootDrawer = RootDrawer;
         game.Run();
     }
 }
Beispiel #8
0
 /// <summary>
 /// Add an updater for each cycle
 /// </summary>
 /// <param name="updater">Updater</param>
 /// <returns>True if added, false if null or already in the list</returns>
 public bool AddUpdater(IUpdater updater)
 {
     if (updater != null)
     {
         lock (updaters)
         {
             return(updaters.Add(updater));
         }
     }
     return(false);
 }
        private void handleUpdate()
        {
            if (hasErrors())
            {
                return;
            }
            IUpdater <SongModel> updater = createUpdater();

            Collection.handleMultipleUpdateRequest(updater);
            clear();
        }
        public WindowsDesktopUpdaterSubStep(WindowsDesktopUpdateStep windowsDesktopUpdateStep, IUpdater <IProject> updater, ILogger <WindowsDesktopUpdateStep> logger)
            : base(logger)
        {
            if (logger is null)
            {
                throw new ArgumentNullException(nameof(logger));
            }

            ParentStep = _windowsDesktopUpdateStep = windowsDesktopUpdateStep ?? throw new ArgumentNullException(nameof(windowsDesktopUpdateStep));
            _updater   = updater ?? throw new ArgumentNullException(nameof(updater));
        }
Beispiel #11
0
        public InMemoryCollection(IMongoDatabase db, VanillaCollection vCol, IFilter whereFilter, IUpdater updater)
        {
            Database         = db ?? throw new ArgumentNullException(nameof(db));
            this.vCol        = vCol ?? throw new ArgumentNullException(nameof(vCol));
            this.whereFilter = whereFilter ?? throw new ArgumentNullException(nameof(whereFilter));
            this.updater     = updater ?? throw new ArgumentNullException(nameof(updater));
            var map = BsonClassMap.LookupClassMap(typeof(T));

            idGenerator    = (idMemeber = map.IdMemberMap)?.IdGenerator;
            bsonSerializer = BsonSerializer.SerializerRegistry.GetSerializer <T>();
        }
        private void handleUpdate()
        {
            if (UpdateType.hasErrors())
            {
                return;
            }
            IUpdater <TagModel> updater = TagUpdater.createTypeUpdater(UpdateType.Value);

            Collection.handleMultipleUpdateRequest(updater);
            clear();
        }
Beispiel #13
0
 public override void Initial()
 {
     if (SettingsUpdater == null)
     {
         SettingsUpdater = new DefaultSettingsUpdater(CreateDatabaseAccess());
     }
     SettingsUpdater.SettingsUpdateAction = changedKeys =>
     {
         LoadSettingValues();
     };
     SettingsUpdater.Start();
 }
        public async Task Should_Download_RELEASES()
        {
            IUpdater updater = StartupSingletons.BlobStorageUpdater;
            var      latest  = await updater.FindLatestVersionAsync("brainside", "win32", "x64");

            string squirrel = latest.ToSquirrelWindows();

            string[] pieces = squirrel.Split(' ');
            Assert.NotEmpty(pieces);

            Assert.Equal(latest.UpdateDownloadUrl, pieces[1]);
        }
Beispiel #15
0
        /// <summary>
        ///     Core implementation of a bulk entity update.
        /// </summary>
        /// <param name="expression">
        ///     A query expression that represents the entities to be updated.
        /// </param>
        /// <param name="updater">
        ///     An expression that represents the update mechanism.
        /// </param>
        /// <param name="transaction">
        ///     The transaction within which the update operation is executed.
        /// </param>
        /// <returns>
        ///     The updated entities.
        /// </returns>
        protected override IEnumerable <TEntity> UpdateCore(
            Expression expression,
            IUpdater <TEntity> updater,
            Transaction transaction)
        {
            IExecutionContext context =
                new ExecutionContext(this.Database, transaction, OperationType.Update);

            var query = this.Compiler.Compile <IEnumerable <TEntity> >(expression);

            return(this.Executor.ExecuteUpdater(query, updater, context));
        }
 public override void EndUpdate(IUpdater updater)
 {
     UpdateDataEnd(updater);
     if (updater is Updater)
     {
         var etUpdater = (Updater)updater;
         if (etUpdater.m_DataUpdater is FieldUpdater)
         {
             SetFieldsList((etUpdater.m_DataUpdater as FieldUpdater).m_Fields);
         }
     }
 }
Beispiel #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OptionsControlViewModel" /> class.
 /// </summary>
 /// <param name="messageBus">The message bus.</param>
 /// <param name="logger">The logger.</param>
 /// <param name="notificationAction">The notification action.</param>
 /// <param name="localizationManager">The localization manager.</param>
 /// <param name="updater">The updater.</param>
 /// <param name="updaterService">The updater service.</param>
 /// <param name="gameService">The game service.</param>
 /// <param name="fileDialogAction">The file dialog action.</param>
 public OptionsControlViewModel(Shared.MessageBus.IMessageBus messageBus, ILogger logger, INotificationAction notificationAction, ILocalizationManager localizationManager, IUpdater updater,
                                IUpdaterService updaterService, IGameService gameService, IFileDialogAction fileDialogAction)
 {
     this.gameService         = gameService;
     this.fileDialogAction    = fileDialogAction;
     this.updaterService      = updaterService;
     this.updater             = updater;
     this.localizationManager = localizationManager;
     this.notificationAction  = notificationAction;
     this.logger     = logger;
     this.messageBus = messageBus;
 }
Beispiel #18
0
 public EditGameModel(IGameRetriever gameRetriever,
                      IPlayerRetriever playerRetriever, ICreator <Game> gameCreator,
                      IUpdater <Game> gameUpdater, ITeamUpdater teamUpdater,
                      IWebHostEnvironment env)
 {
     this.gameRetriever   = gameRetriever;
     this.playerRetriever = playerRetriever;
     this.gameCreator     = gameCreator;
     this.gameUpdater     = gameUpdater;
     this.teamUpdater     = teamUpdater;
     this.env             = env;
 }
Beispiel #19
0
        public UpdateProcess(IDictionary <CommandLineParameter, string> parameters, int killInitiatingProcessTimeout)
        {
            this.initiatingProcess = GetInitiatingProcess(parameters);

            KeyValuePair <IUpdateManifest, string> manifestAndPath = RetrieveUpdateManifest(parameters);

            this.manifest     = manifestAndPath.Key;
            this.manifestPath = manifestAndPath.Value;

            this.updater                      = UpdaterFactory.Create(manifest);
            this.followUpProcessPath          = GetParameterValue <string>(CommandLineParameter.FollowUpProcess, parameters);
            this.killInitiatingProcessTimeout = killInitiatingProcessTimeout;
        }
Beispiel #20
0
        public void SetUp()
        {
            _updater    = Substitute.For <IUpdater>();
            _calculator = new Calculator(_updater);

            _updater.TrackStartCal += (o, args) =>
            {
                _newTrackStartCal  = args.NewTrack;
                _prevTrackStartCal = args.PrevTrack;
                _calculatedTrack   = args.CalculatedTrack;
                _nEventsReceived++;
            };
        }
Beispiel #21
0
 protected void UpdateDataEnd(IUpdater aUpdater)
 {
     if (aUpdater is Updater)
     {
         var updater = (Updater)aUpdater;
         foreach (var g in updater.m_NewExpandedGroupUpdater)
         {
             var table = updater.m_NewData.m_ExpandedGroup[g.Key].table;
             table.EndUpdate(g.Value);
         }
         m_Data = updater.m_NewData;
     }
 }
Beispiel #22
0
        private void InitOpenedOrdersUpdater()
        {
            _openedOrdersUpdater          = OpenedOrdersUpdaterProvider.GetUpdater(Market, _openedOrdersRefreshInterval);
            _openedOrdersUpdater.Changed += OpenedOrdersUpdater_Changed;

            _openedOrdersUpdater.ImmediatelyUpdateIfOlder(_openedOrdersRefreshInterval);
            if (_openedOrdersUpdater.LastValue != null)
            {
                SetOpenedOrders(_openedOrdersUpdater.LastValue);
            }

            _openedOrdersUpdater.Start();
        }
Beispiel #23
0
 public UpdateProgramWindowViewModel(IUpdater updater, IMessenger messenger, IConfigurationService configurationService, ILanguageService languageService, IFlexClient flexClient, ILoggerService loggerService)
 {
     this._updater              = updater;
     this._messenger            = messenger;
     this._configurationService = configurationService;
     this._languageService      = languageService;
     this._flexClient           = flexClient;
     this._loggerService        = loggerService;
     this.UpdateLanguage((OnLanguageChanged)null);
     messenger.Register <OnLanguageChanged>((object)this, new Action <OnLanguageChanged>(this.UpdateLanguage));
     this.CheckForUpdates((OnCheckForUpdates)null);
     messenger.Register <OnCheckForUpdates>((object)this, new Action <OnCheckForUpdates>(this.CheckForUpdates));
 }
        public static void Start(IUpdater Updater)
        {
            var Factory = SingletonFactory.GetInstance <UpdaterFactory>();
            var ID      = Updater.GetHashCode();

            if (!Factory.Tasks.ContainsKey(ID))
            {
                lock (Factory.syncLock)
                    Factory.Tasks.Add(ID, new UpdaterTask(Updater));
            }

            Start(ID);
        }
Beispiel #25
0
        static void Main()
        {
            IUpdater updater = UpdaterHelper.GetInstance("MyAuto");

            if (updater.Run())
            {
                return;
            }

            Application.SetHighDpiMode(HighDpiMode.SystemAware);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FormMain());
        }
        private void SetUpdaters(PairOfMarket pair)
        {
            if (!IsMayRunUpdater)
            {
                return;
            }

            _updater = HistoryPricesUpdaterProvider.GetUpdater(
                new HistoryPriceFeature(pair, Timeframe.Value, BarCount),
                _refreshInterval);
            _updater.Changed += HistoryPriceUpdater_Changed;
            //SetUpdaterSettings();
            _updater.Start();
        }
    public WheelAnimation(Rigidbody rigidbody, Axles[] axles, IUpdater updater)
    {
        this.rigidbody = rigidbody;
        wheels         = new List <WheelCollider>();

        foreach (Axles axle in axles)
        {
            wheels.Add(axle.leftWheel);
            wheels.Add(axle.rightWheel);
        }

        updater.OnUpdateEvent += RotateWheels;
        updater.OnUpdateEvent += SpinWheels;
    }
        public void handleMultipleUpdateRequest(IUpdater <T> updater)
        {
            var           model_list = getHighlightedVMs();
            MessageResult response   = request_handler.handleMultipleEdited(model_list, updater);

            if (response.Error == null)
            {
                foreach (T model in model_list)
                {
                    replaceWithViewVm(model, updater.updateModel(model));
                }
            }
            setErrorAndMessage(response);
        }
        public SquirreledHost(
            ISelfUpdatableService selfUpdatableService,
            string serviceName        = null,
            string serviceDisplayName = null, IUpdater updater = null, bool withOverlapping = false, bool promtCredsWhileInstall = false)
        {
            var assemblyName = Assembly.GetEntryAssembly().GetName().Name;

            this.serviceName            = serviceName ?? assemblyName;
            this.serviceDisplayName     = serviceDisplayName ?? assemblyName;
            this.selfUpdatableService   = selfUpdatableService;
            this.withOverlapping        = withOverlapping;
            this.promtCredsWhileInstall = promtCredsWhileInstall;
            this.updater = updater;
        }
        public MainApplicationContext()
        {
            Application.ApplicationExit += new EventHandler(Application_ApplicationExit);

            syncCntx = new WindowsFormsSynchronizationContext();

            installer = new Installer(this);
            if (installer.CheckNeedInstall())
            {
                installer.InstallAsync();

                return;
            }
            installer = null;

            stopTimer = new ManualResetEvent(false);
            passTimer = new ManualResetEvent(true);

            lastWorking = s.IsCheckOnlyWhenStartup;

            if (Program.ArgumentExists("/setstartup")
                || s.InitialStart)
            {
                s.RunOnStartup = true;
            }

            if (IsNeededToShowSettings())
            {
                ShowSettings();
            }

            SingleInstanceProgram.Instance.AnotherProcessLaunched += new EventHandler<EventArgs>(Instance_AnotherProcessLaunched);

            updater = new GitHubUpdater("iamxail", Program.SafeName);
            #if DEBUG
            //do nothing
            #else
            updater.CheckCompleted += new CheckCompletedEventHandler(updater_CheckCompleted);
            updater.UpdateCompleted += new UpdateCompletedEventHandler(updater_UpdateCompleted);
            updater.CheckAsync();
            #endif

            tmrDownload = new System.Timers.Timer();
            tmrDownload.Interval = 5000;
            tmrDownload.Elapsed += new System.Timers.ElapsedEventHandler(tmrDownload_Elapsed);
            tmrDownload.Start();

            tray = new TrayIcon();
        }
Beispiel #31
0
        static void Main()
        {
            IUpdater updater = UpdaterFactory.Create("http://appupdater.com:84", "releases.txt");

            Console.WriteLine(@"Version is " + updater.CurrentRelease);

            ICheckForUpdateResult checkForUpdateResult = updater.CheckForUpdate();

            if (checkForUpdateResult.IsUpdateAvailable)
            {
                updater.Update();
            }

            Console.Read();
        }
Beispiel #32
0
        /// <summary>
        /// constructor
        /// </summary>
        /// <param name="updater"></param>
        public Site(IUpdater updater, string fileName)
        {
            try
            {
                this.Updater  = updater;
                this.fileName = fileName;

                //read mangas from file
                this.read();
            }
            catch (Exception)
            {
                throw;
            }
        }
 public ConnectionHandler(
     ILogger <ConnectionHandler> logger,
     IConnectionInitializer connectionInitializer,
     IConnectedClientStore connectedClients,
     IMessageDispatcher messageDispatcher,
     IUpdateDetector updateDetector,
     IUpdater updater)
 {
     _logger = logger;
     _connectionInitializer = connectionInitializer;
     _connectedClients      = connectedClients;
     _messageDispatcher     = messageDispatcher;
     _updateDetector        = updateDetector;
     _updater = updater;
 }
 public MainViewModel(IAppReduxDispatcher appReduxDispatcher, IUpdater updater, IAppUpdater appUpdater, Func <Server, ServerViewModel> serverViewModelFactory)
 {
     logger.Info($"Welcome to AutoMasshTik v{typeof(MainViewModel).Assembly.GetName().Version}");
     this.appReduxDispatcher     = appReduxDispatcher;
     this.updater                = updater;
     this.appUpdater             = appUpdater;
     this.serverViewModelFactory = serverViewModelFactory;
     state                                 = appReduxDispatcher.InitialState;
     ServerModels                          = state.Servers;
     Servers                               = new ObservableCollection <ServerViewModel>();
     StartUpdateCommand                    = new RelayCommand <UpdateMode>(StartUpdate, m => !IsUpdating);
     StopUpdateCommand                     = new RelayCommand(StopUpdate, () => IsUpdating);
     ToggleShowPasswordCommand             = new RelayCommand(ToggleShowPassword);
     this.appReduxDispatcher.StateChanged += AppReduxDispatcher_StateChanged;
 }
Beispiel #35
0
        internal static IObservable <IReadOnlyList <NotifyCollectionChangedEventArgs> > Create(
            IUpdater updater,
            IEnumerable source,
            TimeSpan throttleTime,
            IScheduler scheduler,
            bool signalInitial)
        {
            var incc = source as INotifyCollectionChanged;

            if (incc == null)
            {
                return(Empty);
            }

            var observable = Observable.Create <NotifyCollectionChangedEventArgs>(o =>
            {
                NotifyCollectionChangedEventHandler fsHandler = (_, e) =>
                {
                    var isUpdatingSourceItem = updater.IsUpdatingSourceItem;
                    if (isUpdatingSourceItem == null)
                    {
                        o.OnNext(e);
                        return;
                    }
                    var newItem = e.IsSingleNewItem()
                                              ? e.NewItem <object>()
                                              : null;
                    if (ReferenceEquals(isUpdatingSourceItem, newItem))
                    {
                        return;
                    }

                    var oldItem = e.IsSingleOldItem()
                                              ? e.OldItem <object>()
                                              : null;
                    if (ReferenceEquals(isUpdatingSourceItem, oldItem))
                    {
                        return;
                    }

                    o.OnNext(e);
                };
                incc.CollectionChanged += fsHandler;
                return(Disposable.Create(() => incc.CollectionChanged -= fsHandler));
            });

            return(observable.Buffer(throttleTime, scheduler, signalInitial));
        }
        public DownloadForm(IUpdater updater, IAppCast appcast)
        {
            InitializeComponent();

            this.updater = updater;
            this.appcast = appcast;

            downloader = ServiceLocator.GetInstance<IDownloader>();
            installer = ServiceLocator.GetInstance<IInstaller>();
            localizationService = ServiceLocator.GetInstance<ILocalizationService>();

            ToogleControls();
            Localize();
            SetTempFileName();
            StartDownload();
        }
Beispiel #37
0
 public AgentSocket(ConfigService configService,
                    Uninstaller uninstaller,
                    ScriptExecutor scriptExecutor,
                    ChatClientService chatService,
                    IAppLauncher appLauncher,
                    IUpdater updater,
                    IDeviceInformationService deviceInfoService)
 {
     _configService     = configService;
     _uninstaller       = uninstaller;
     _scriptExecutor    = scriptExecutor;
     _appLauncher       = appLauncher;
     _chatService       = chatService;
     _updater           = updater;
     _deviceInfoService = deviceInfoService;
 }
Beispiel #38
0
 public AgentSocket(ConfigService configService,
                    Uninstaller uninstaller,
                    CommandExecutor commandExecutor,
                    ScriptRunner scriptRunner,
                    ChatHostService chatService,
                    IAppLauncher appLauncher,
                    IUpdater updater)
 {
     ConfigService   = configService;
     Uninstaller     = uninstaller;
     CommandExecutor = commandExecutor;
     ScriptRunner    = scriptRunner;
     AppLauncher     = appLauncher;
     ChatService     = chatService;
     Updater         = updater;
 }
Beispiel #39
0
        public UpdateAnimal(UpdateAnimalViewModel model)
        {
            InitializeComponent();
            this._animal = (Animal)model.GetEditableItem();

            vm = model;

            animalName.Text              = _animal.Name;
            registryCode.Text            = _animal.RegistryCode;
            animalKindId.SelectedValue   = _animal.AnimalKindId;
            animalBirthDate.SelectedDate = _animal.BirthDate;
            //animalSex.IsChecked = animal.Sex;
            ration.SelectedValue = _animal.RationId;

            DataContext = vm;
        }
Beispiel #40
0
        public UpdaterViewModel(IUpdater updater, IEventAggregator eventAggregator)
        {
            _updater = updater;
            _eventAggregator = eventAggregator;

            AvaliableUpdates = new List<ModuleManifestWrapper>();
            Info = "Idle";

            // command initialization, execution and and canExecute logic
            _checkCommand = new RelayCommand(CheckMethod, CheckPredicate);
            _prepareCommand = new RelayCommand(PrepareMethod, PreparePredicate);
            _performCommand = new RelayCommand(PerformMethod, PerformPredicate);

            // subscribe for updater events
            _eventAggregator.Subscribe<NomadAvailableUpdatesMessage>(UpdatedAvaliableCallback);
            _eventAggregator.Subscribe<NomadUpdatesReadyMessage>(UpdatesReadyCallback);
        }
        public void Install(string fileName, IUpdater updaterInstance)
        {
            updater = updaterInstance;

            string extension = Path.GetExtension(fileName);
            if(extension != null && extension.ToLower().Equals(".msi"))
            {
                batchCommand = "msiexec /i \"" + fileName + "\"";
            }
            else
            {
                string message = string.Format(localizationService.GetString(LocalizationResourceNames.InstallerExtensionNotSupportedMessage), extension, fileName);
                string caption = localizationService.GetString(LocalizationResourceNames.InstallerMessageBoxCaption);

                MessageBox.Show(message, caption, MessageBoxButtons.OK, MessageBoxIcon.Error);

                return;
            }

            WriteBatchFile();
            ExecuteBatchFile();
        }
Beispiel #42
0
 private void CheckForUpdates()
 {
     _updater = _locator.Resolve<IUpdater>();
         _updater.CheckUpdates();
 }
 public KinectAxis(string name, IUpdater<float> deadzone, IUpdater<float> scale, AxisBinding binding)
     : base(name, deadzone, scale, binding)
 {
     Init();
 }
Beispiel #44
0
 public static void AddUpdater( String typeName, IUpdater obj )
 {
     dic.Add( typeName, obj );
 }
Beispiel #45
0
 private static bool UpdateMapper(ReceiverList<IUpdater, int> list, IUpdater receiver, int parameter)
 {
     return receiver.Update(parameter);
 }
Beispiel #46
0
        void Planet(Drawable drawable, IUpdater updater)
        {
            // Fix me!
              bool hourspec = true;
              bool inclspec = true;

              new Planet(drawable,
             GetValue<int>("type") == 2,
             GetValue<double>("stars_fraction"),
             GetValue<double>("saturation"),
             GetValue<int>("type") == 1,
             _random,
             GetValue<double>("ice_level"),
             GetValue<double>("glaciers"),
             GetValue<double>("dimension"),
             hourspec, GetValue<double>("hour"),
             inclspec, GetValue<double>("inclination"),
             GetValue<double>("power"), updater);
        }
		public OptionsDialogViewModel(IUpdater updateService)
		{
			this.updater = updateService;
			this.updater.UpdateDownloadProgress += this.OnUpdateDownloadProgress;
			this.updater.UpdateStateChanged += this.OnUpdateStateChanged;

			this.updatesEnabledConfig = Config.UpdatesEnabled;
			this.defaultPath = Config.AutoNameOutputFolder;
			this.customFormat = Config.AutoNameCustomFormat;
			this.customFormatString = Config.AutoNameCustomFormatString;
			this.outputToSourceDirectory = Config.OutputToSourceDirectory;
			this.preserveFolderStructureInBatch = Config.PreserveFolderStructureInBatch;
			this.useCustomPreviewFolder = Config.UseCustomPreviewFolder;
			this.previewOutputFolder = Config.PreviewOutputFolder;
			this.whenFileExists = CustomConfig.WhenFileExists;
			this.whenFileExistsBatch = CustomConfig.WhenFileExistsBatch;
			this.minimizeToTray = Config.MinimizeToTray;
			this.useCustomVideoPlayer = Config.UseCustomVideoPlayer;
			this.customVideoPlayer = Config.CustomVideoPlayer;
			this.playSoundOnCompletion = Config.PlaySoundOnCompletion;
			this.useCustomCompletionSound = Config.UseCustomCompletionSound;
			this.customCompletionSound = Config.CustomCompletionSound;
			this.autoAudio = CustomConfig.AutoAudio;
			this.audioLanguageCode = Config.AudioLanguageCode;
			this.autoAudioAll = Config.AutoAudioAll;
			this.autoSubtitle = CustomConfig.AutoSubtitle;
			this.autoSubtitleBurnIn = Config.AutoSubtitleBurnIn;
			this.autoSubtitleLanguageDefault = Config.AutoSubtitleLanguageDefault;
			this.autoSubtitleLanguageBurnIn = Config.AutoSubtitleLanguageBurnIn;
			this.subtitleLanguageCode = Config.SubtitleLanguageCode;
			this.autoSubtitleOnlyIfDifferent = Config.AutoSubtitleOnlyIfDifferent;
			this.autoSubtitleAll = Config.AutoSubtitleAll;
			this.workerProcessPriority = Config.WorkerProcessPriority;
			this.logVerbosity = Config.LogVerbosity;
			this.copyLogToOutputFolder = Config.CopyLogToOutputFolder;
			this.previewCount = Config.PreviewCount;
			this.rememberPreviousFiles = Config.RememberPreviousFiles;
			this.showAudioTrackNameField = Config.ShowAudioTrackNameField;
			this.keepScansAfterCompletion = Config.KeepScansAfterCompletion;
			this.dxvaDecoding = Config.DxvaDecoding;
			this.enableLibDvdNav = Config.EnableLibDvdNav;
			this.deleteSourceFilesOnClearingCompleted = Config.DeleteSourceFilesOnClearingCompleted;
			this.preserveModifyTimeFiles = Config.PreserveModifyTimeFiles;
			this.resumeEncodingOnRestart = Config.ResumeEncodingOnRestart;
			this.useWorkerProcess = Config.UseWorkerProcess;
			this.minimumTitleLengthSeconds = Config.MinimumTitleLengthSeconds;
			this.autoPauseProcesses = new ObservableCollection<string>();
			this.videoFileExtensions = Config.VideoFileExtensions;
			List<string> autoPauseList = CustomConfig.AutoPauseProcesses;
			if (autoPauseList != null)
			{
				foreach (string process in autoPauseList)
				{
					this.autoPauseProcesses.Add(process);
				}
			}

			// List of language codes and names: http://msdn.microsoft.com/en-us/goglobal/bb896001.aspx

			this.languageChoices =
				new List<InterfaceLanguage>
					{
						new InterfaceLanguage { CultureCode = string.Empty, Display = OptionsRes.UseOSLanguage },
						new InterfaceLanguage { CultureCode = "en-US", Display = "English" },
						new InterfaceLanguage { CultureCode = "cs-CZ", Display = "čeština / Czech" },
						new InterfaceLanguage { CultureCode = "de-DE", Display = "Deutsch / German" },
						new InterfaceLanguage { CultureCode = "es-ES", Display = "Español / Spanish" },
						new InterfaceLanguage { CultureCode = "eu-ES", Display = "Euskara / Basque" },
						new InterfaceLanguage { CultureCode = "fr-FR", Display = "Français / French" },
						new InterfaceLanguage { CultureCode = "it-IT", Display = "italiano / Italian" },
						new InterfaceLanguage { CultureCode = "hu-HU", Display = "Magyar / Hungarian" },
						new InterfaceLanguage { CultureCode = "pl-PL", Display = "polski / Polish" },
						new InterfaceLanguage { CultureCode = "pt-PT", Display = "Português / Portuguese" },
						new InterfaceLanguage { CultureCode = "pt-BR", Display = "Português (Brasil) / Portuguese (Brazil)" },
						new InterfaceLanguage { CultureCode = "tr-TR", Display = "Türkçe / Turkish" },
						new InterfaceLanguage { CultureCode = "ru-RU", Display = "русский / Russian" },
						new InterfaceLanguage { CultureCode = "zh-Hans", Display = "中文(简体) / Chinese (Simplified)" },
						new InterfaceLanguage { CultureCode = "zh-Hant", Display = "中文(繁體) / Chinese (Traditional)" },
						new InterfaceLanguage { CultureCode =  "ja-JP", Display = "日本語 / Japanese" },
					};

			this.priorityChoices = new List<ComboChoice>
				{
					new ComboChoice("High", OptionsRes.Priority_High),
					new ComboChoice("AboveNormal", OptionsRes.Priority_AboveNormal),
					new ComboChoice("Normal", OptionsRes.Priority_Normal),
					new ComboChoice("BelowNormal", OptionsRes.Priority_BelowNormal),
					new ComboChoice("Idle", OptionsRes.Priority_Idle),
				};

			this.interfaceLanguage = this.languageChoices.FirstOrDefault(l => l.CultureCode == Config.InterfaceLanguageCode);
			if (this.interfaceLanguage == null)
			{
				this.interfaceLanguage = this.languageChoices[0];
			}

			this.playerChoices = Players.All;
			if (this.playerChoices.Count > 0)
			{
				this.selectedPlayer = this.playerChoices[0];

				foreach (IVideoPlayer player in this.playerChoices)
				{
					if (player.Id == Config.PreferredPlayer)
					{
						this.selectedPlayer = player;
						break;
					}
				}
			}

#if !BETA
			var betaInfoWorker = new BackgroundWorker();
			betaInfoWorker.DoWork += (o, e) =>
				{
					this.betaInfo = Updater.GetUpdateInfo(true);
				};
			betaInfoWorker.RunWorkerCompleted += (o, e) =>
				{
					this.betaInfoAvailable = false;
					if (this.betaInfo != null)
					{
						if (Utilities.CompareVersions(this.betaInfo.LatestVersion, Utilities.CurrentVersion) > 0)
						{
							this.betaInfoAvailable = true;
						}
					}

					this.RaisePropertyChanged(() => this.BetaChangelogUrl);
					this.RaisePropertyChanged(() => this.BetaSectionVisible);
				};
			betaInfoWorker.RunWorkerAsync();
#endif

			this.SelectedTabIndex = Config.OptionsDialogLastTab;

			this.RefreshUpdateStatus();
		}
Beispiel #48
0
 public void Add(IUpdater updater)
 {
     updaterList.Add(updater);
 }
 protected ConstrainedAxis(string name, IUpdater<float> deadzone, float scale, AxisBinding binding)
     : this(name, deadzone, new Updater<float>("Scale", scale), binding)
 {
 }
        private void RegisterUpdater(Document document, IUpdater updater)
        {
            //register updater
            UpdaterRegistry.RegisterUpdater(updater, document);

            //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), GuidUpdater.GetFilter(document), Element.GetChangeTypeAny());
            //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), GuidUpdater.GetFilter(document), Element.GetChangeTypeElementAddition());
        }
Beispiel #51
0
 internal static void AddUpdater(IUpdater updater)
 {
     updaters.Add(updater);
 }
 public void AddVijand(IUpdater e)
 {
     enemies.Add(e);
 }
 protected ConstrainedAxis(string name, float deadzone, IUpdater<float> scale, AxisBinding binding)
     : this(name, new Updater<float>("Deadzone", deadzone), scale, binding)
 {
 }
        public void Remove(IUpdater updater)
        {
            updater.ThrowIfNull("updater");

            _updaters.Remove(updater);
        }
        public void Add(IUpdater updater)
        {
            updater.ThrowIfNull("updater");

            _updaters.Add(updater);
        }