public void Restore(string url, Guid libraryId, int itemId, string version) { try { var auth = credentials.Get(url); using (var clientContext = new SPContext(url, auth)) { var spfile = clientContext.Web.Lists.GetById(libraryId).GetItemById(itemId).File; clientContext.Load(spfile, f => f.ServerRelativeUrl); clientContext.ExecuteQuery(); var fileName = spfile.ServerRelativeUrl; // There is no way to restore file using Client Object Model using (var service = new VersionService(url, auth)) { service.RestoreVersion(fileName, version); } } } catch (Exception ex) { var message = string.Format("An exception of type {0} occurred in the InternalApi.SPFileService.Restore() method for URL: {1}, LibraryId: {2}, ItemId: {3}, Version: {4}. The exception message is: {5}", ex.GetType(), url, libraryId, itemId, version, ex.Message); SPLog.RoleOperationUnavailable(ex, message); throw new SPInternalException(message); } }
public ReadMeViewModel(VersionService versioningService) { StudioVersions = versioningService.GetListOfStudioVersions(); StudioVersions.Reverse(); MultitermVersions = versioningService.GetInstalledMultitermVersions(); }
public void ReleaseHasNoAssets() { string expected = ""; Mock <IHTTPService> httpService = new Mock <IHTTPService>(); httpService.Setup(hs => hs.SendGetRequest(It.IsAny <string>())).Returns( @"{ ""url"": ""https://api.github.com/repos/MarioZG/elder-scrolls-legends-tracker/releases/5198358"", ""assets_url"": ""https://api.github.com/repos/MarioZG/elder-scrolls-legends-tracker/releases/5198358/assets"", ""assets"": [ ], ""tarball_url"": ""https://api.github.com/repos/MarioZG/elder-scrolls-legends-tracker/tarball/v0.6.0"", ""zipball_url"": ""https://api.github.com/repos/MarioZG/elder-scrolls-legends-tracker/zipball/v0.6.0"", ""body"": ""## New features\r\n- Track changes in deck and compare win ratio of different versions\r\n- Import decks from text\r\n- Filter Statistics by Deck #7 \r\n- Update cards database to reflect card changes from January 2017\r\n- About form with contact info\r\n\r\n## Fixes\r\n- Sometimes edit game window blocked closing application\r\n- Double click on system tray icon now opens/hides main form\r\n- Number of minor fixes and performance improvements\r\n"" } "); Mock <ICardsDatabase> cardsDB = new Mock <ICardsDatabase>(); cardsDB.Setup(a => a.Version).Returns( new Version(0, 4) ); Mock <ITrackerFactory> trackerFactory = new Mock <ITrackerFactory>(); trackerFactory.Setup(tf => tf.GetService <IHTTPService>()).Returns(httpService.Object); trackerFactory.Setup(tf => tf.GetService <ICardsDatabase>()).Returns(cardsDB.Object); trackerFactory.Setup(tf => tf.GetService <ISettings>()).Returns(settings.Object); VersionService vc = new VersionService(trackerFactory.Object); string actual = vc.GetLatestDownladUrl(); Assert.AreEqual(expected, actual); }
void NewPackage() { //自动保存设置文件 CreatePackageFile(); //生成资源路径文件 ResourcesConfigManager.CreateResourcesConfig(); //自动增加小版本号 VersionService.SmallVersion++; VersionService.CreateVersionFile(); //清除旧打包信息 ClearAssetBundlesName(); //自动设置打包信息 SetAssetsInfo(); //删除streaming下所有旧资源 if (Directory.Exists(Application.dataPath + "/StreamingAssets")) { FileTool.DeleteDirectory(Application.dataPath + "/StreamingAssets"); } else { FileTool.CreatPath(Application.dataPath + "/StreamingAssets"); } BuildPipeline.BuildAssetBundles(Application.dataPath + "/StreamingAssets/", BuildAssetBundleOptions.None, PackageService.GetTargetPlatform); //删除所有manifest文件 DeleteManifestFile(Application.dataPath + "/StreamingAssets/"); //清除旧打包信息 ClearAssetBundlesName(); }
public void GetVersionMajorMinor() { var versionDetail = new VersionRequest() { ProductId = 1, Major = 8, Minor = 2 }; var repository = new Mock <IVersionDetailRepository>(); repository.Setup(x => x.GetByProductId(versionDetail.ProductId)) .Returns(VersionDetails .Where(x => x.Product.Id == versionDetail.ProductId && x.Version.Major == versionDetail.Major)); var service = new VersionService(repository.Object); var version = service.GetVersions(versionDetail); version.Count().Should().Be(1); var expectedVersion = new VersionSimple(8, 2, 100, 0); version.First().Version.Major.Should().Be(expectedVersion.Major); version.First().Version.Minor.Should().Be(expectedVersion.Minor); version.First().Version.Build.Should().Be(expectedVersion.Build); version.First().Version.Revision.Should().Be(expectedVersion.Revision); }
/// <summary> /// Construct a new ConfigForm and initialize it with ConfigHelper. /// </summary> public ConfigForm() { InitializeComponent(); // Show welcome message if this is the first launch of the app if (!SettingsService.Current.NoWelcome) { MessageBox.Show(Resources.WelcomeMessage, "SharpCrop"); SettingsService.Current.NoWelcome = true; } // Init version checker var url = VersionService.GetLatestLink(); if (url != null) { updateLinkLabel.LinkClicked += (s, e) => Process.Start(url); updateLinkLabel.Show(); } // Register an update event and update provider list ProviderService.RegisteredProvidersChanged += UpdateProviderList; ProviderService.LoadedProvidersChanged += UpdateProviderList; UpdateProviderList(); }
public AuthController( ServiceLocation serviceLocation, AuthService <KahlaUser> authService, UserManager <KahlaUser> userManager, SignInManager <KahlaUser> signInManager, UserService userService, AppsContainer appsContainer, KahlaPushService pusher, ChannelService channelService, VersionChecker version, VersionService sdkVersion, KahlaDbContext dbContext, IOptions <List <DomainSettings> > optionsAccessor, EventService eventService, OnlineJudger onlineJudger, AiurCache cache) { _serviceLocation = serviceLocation; _authService = authService; _userManager = userManager; _signInManager = signInManager; _userService = userService; _appsContainer = appsContainer; _pusher = pusher; _channelService = channelService; _version = version; _sdkVersion = sdkVersion; _dbContext = dbContext; _eventService = eventService; _onlineJudger = onlineJudger; _cache = cache; _appDomains = optionsAccessor.Value; }
public StartUp( ConversationService conversationService, FriendshipService friendshipService, AuthService authService, HomeService homeService, KahlaLocation kahlaLocation, BotLogger botLogger, IEnumerable <BotBase> bots, VersionService versionService, SettingsService settingsService, AES aes) { var bot = BotConfigurer.SelectBot(bots, settingsService, botLogger); bot.BotLogger = botLogger; bot.AES = aes; bot.ConversationService = conversationService; bot.FriendshipService = friendshipService; bot.HomeService = homeService; bot.KahlaLocation = kahlaLocation; bot.AuthService = authService; bot.VersionService = versionService; bot.SettingsService = settingsService; _bot = bot; }
public ActionResult Delete(int id) { var svc = new VersionService(); var model = svc.GetVersionById(id); return(View(model)); }
void HotUpdateGUI() { GUILayout.Space(10); if (!ConfigManager.GetIsExistConfig(HotUpdateManager.c_HotUpdateConfigName)) { if (GUILayout.Button("热更新设置初始化")) { InitHotUpdateConfig(); } } else { GUILayout.BeginHorizontal(); VersionService.LargeVersion = EditorGUILayout.IntField("large", VersionService.LargeVersion); VersionService.SmallVersion = EditorGUILayout.IntField("small", VersionService.SmallVersion); if (GUILayout.Button("保存版本文件")) { VersionService.CreateVersionFile(); } GUILayout.EndHorizontal(); } }
public EmailClient(ILogService log, ISettingsService settings, VersionService version) { _log = log; _settings = settings; _server = _settings.Notification.SmtpServer; _port = _settings.Notification.SmtpPort; _user = _settings.Notification.SmtpUser; _password = _settings.Notification.SmtpPassword; _secure = _settings.Notification.SmtpSecure; _secureMode = _settings.Notification.SmtpSecureMode; _senderName = _settings.Notification.SenderName; _computerName = _settings.Notification.ComputerName; if (string.IsNullOrEmpty(_computerName)) { _computerName = Environment.MachineName; } _version = version.SoftwareVersion.ToString(); if (string.IsNullOrWhiteSpace(_senderName)) { _senderName = _settings.Client.ClientName; } _senderAddress = _settings.Notification.SenderAddress; _receiverAddresses = _settings.Notification.ReceiverAddresses ?? new List <string>(); // Criteria for emailing to be enabled at all Enabled = !string.IsNullOrEmpty(_senderAddress) && !string.IsNullOrEmpty(_server) && _receiverAddresses.Any(); _log.Verbose("Sending e-mails {_enabled}", Enabled); }
public static async Task <WalletClient> ConnectAsync(string networkAddress, string rootCertificate) { if (networkAddress == null) { throw new ArgumentNullException(nameof(networkAddress)); } if (rootCertificate == null) { throw new ArgumentNullException(nameof(rootCertificate)); } var channel = new Channel(networkAddress, new SslCredentials(rootCertificate)); var deadline = DateTime.UtcNow.AddSeconds(3); try { await channel.ConnectAsync(deadline); } catch (TaskCanceledException) { await channel.ShutdownAsync(); throw new ConnectTimeoutException(); } // Ensure the server is running a compatible version. var versionClient = VersionService.NewClient(channel); var response = await versionClient.VersionAsync(new VersionRequest(), deadline : deadline); var serverVersion = new SemanticVersion(response.Major, response.Minor, response.Patch); SemanticVersion.AssertCompatible(RequiredRpcServerVersion, serverVersion); return(new WalletClient(channel)); }
public MultipleInstallerTests() { log = new mock.LogService(false); version = new VersionService(log); plugins = new mock.MockPluginService(log, version); settings = new mock.MockSettingsService(); }
public GameInstallViewModel( ConfigService configService, GamePathService gamePathService, VersionService versionService, LibraryService libraryService, AssetService assetService, DownloadStatusViewModel downloadVM, IWindowManager windowManager) { _config = configService.Entries; _gamePathService = gamePathService; _versionService = versionService; _libraryService = libraryService; _assetService = assetService; _versionDownloads = new BindableCollection <VersionDownload>(); VersionDownloads = CollectionViewSource.GetDefaultView(_versionDownloads); VersionDownloads.Filter = obj => { if (_isReleaseOnly) { return((obj as VersionDownload).Type == VersionType.Release); } return(true); }; _windowManager = windowManager; _downloadStatusVM = downloadVM; _isVersionListLoaded = false; _isReleaseOnly = true; }
// GET: Version public ActionResult Index() { var service = new VersionService(); var model = service.GetVersions(); return(View(model)); }
public BotHost( BotCommander <T> botCommander, BotLogger botLogger, SettingsService settingsService, KahlaLocation kahlaLocation, FriendshipService friendshipService, HomeService homeService, VersionService versionService, AuthService authService, EventSyncer <T> eventSyncer, ProfileContainer profileContainer, BotFactory <T> botFactory) { _botCommander = botCommander.InjectHost(this); _botLogger = botLogger; _settingsService = settingsService; _kahlaLocation = kahlaLocation; _friendshipService = friendshipService; _homeService = homeService; _versionService = versionService; _authService = authService; _eventSyncer = eventSyncer; _profileContainer = profileContainer; _botFactory = botFactory; }
public ManualTests() { log = new Mock.Services.LogService(false); iis = new Mock.Clients.MockIISClient(log); version = new VersionService(log); plugins = new MockPluginService(log, version); }
// this constructor is called from XAML - use fixed dependencies public MiningViewModel() { // enforce a minimum of ten seconds for the polling period var pollingPeriod = TimeSpan.FromSeconds(Math.Max(TimeSpan.FromSeconds(10).TotalSeconds, Settings.Default.MinerWatchdogPollingPeriod.TotalSeconds)); if (pollingPeriod != Settings.Default.MinerWatchdogPollingPeriod) { AddMessage(string.Format("Setting MinerWatchdogPollingPeriod to minimum polling period [{0}].", pollingPeriod)); } IController controller = null; ISummaryDataManager dataManager = null; if (!IsDesignMode) { var minerComms = new MinerCommunication(Settings.Default.MinerProcessName, Settings.Default.LaunchCommand, Settings.Default.ImportantProcessNames.Cast <string>()); controller = new Controller(minerComms, pollingPeriod); dataManager = new SummaryDataManager(Settings.Default.SaveInterval); } var idleTimeProvider = new IdleTimeProvider(); var windowController = new WindowController(); var conn = new Connection(new ProductHeaderValue(Title.Replace(" ", string.Empty))); var api = new ApiConnection(conn); var releasesClient = new ReleasesClient(api); var versionService = new VersionService(releasesClient, GitHubOwner, GitHubRepo); this.InitializeDesignTime(controller, idleTimeProvider, dataManager, windowController, versionService); }
private CacheExpireResult getCacheExpireResult() { bool cacheExpire = false; string currentCacheVersion = null; if (!_cacheModifyDateTime.HasValue) { cacheExpire = true; currentCacheVersion = VersionService.GetVersion(CacheVersionConfigurationName); } else { if ((DateTime.UtcNow - _cacheModifyDateTime.Value).TotalSeconds > CacheVersionQueryTimeout) { currentCacheVersion = VersionService.GetVersion(CacheVersionConfigurationName); if (currentCacheVersion != _cacheVersion) { cacheExpire = true; } } } return(new CacheExpireResult() { CacheExpire = cacheExpire, CurrentCacheVersion = currentCacheVersion }); }
public ActionResult GetAllVersion(int id) { var service = new VersionService(); var result = service.GetAllVersion(id); return(Json(result, JsonRequestBehavior.AllowGet)); }
public App( SfLocator locator, SfProjectHandler projectHandler, ServiceHashCalculator hasher, IHandleClusterConnection fabricRemote, VersionHandler versionHandler, VersionService versionService, Packager packager, AppConfig baseConfig, DeployScriptCreator scriptCreator, ConsoleWriter log, ManifestHandler manifestReader, VersionMapHandler versionMapHandler, Hack hack) { _locator = locator; _projectHandler = projectHandler; _hasher = hasher; _fabricRemote = fabricRemote; _versionHandler = versionHandler; _versionService = versionService; _packager = packager; _baseConfig = baseConfig; _scriptCreator = scriptCreator; _log = log; _manifestReader = manifestReader; _versionMapHandler = versionMapHandler; _hack = hack; }
public UpgradeFileInfo GetVersionInfo() { var fileVersions = VersionService.GetLastestVersion(); var lastVersion = fileVersions.Versions.Where(m => m.IsLastVersion).SingleOrDefault(); return(lastVersion); }
public IActionResult SearchResults(VersionSearchViewModel viewModel) { var versionService = new VersionService(); viewModel.SearchResults = versionService.GetSoftwareGreaterThanInput(viewModel.SearchTerm); return(View("Index", viewModel)); }
public void RestoreVersion(SPList list, string fileName, string fileVersion) { // There is no way to restore file using Client Object Model using (var service = new VersionService(list.SPWebUrl, credentials.Get(list.SPWebUrl))) { service.RestoreVersion(fileName, fileVersion); } }
public ActionResult ConfirmVersion(string versionName) { var fileVersions = VersionService.GetLastestVersion(); var version = fileVersions.Versions.FirstOrDefault(m => m.VersionName.ToUpper() == versionName.ToUpper()); return(Json(new { CanUse = version == null, Message = version != null ? "版本号重复" : "" })); }
public override async void OnReceive(Context context, Intent intent) { try { if (!SimpleIoc.Default.IsRegistered <IApplicationService>()) { Log.Info("VERSION", "Application service not registered. Registering new instance..."); SimpleIoc.Default.Register <IApplicationService, ApplicationService>(); } NewVersion version = await VersionService.CheckForUpdates(); if (version != null) { string message = intent.GetStringExtra("message"); string title = intent.GetStringExtra("title"); Intent notificationIntent = new Intent(Intent.ActionView); notificationIntent.SetData(Android.Net.Uri.Parse(version.ReleaseUrl)); PendingIntent pending = PendingIntent.GetActivity(context, 0, notificationIntent, PendingIntentFlags.CancelCurrent | PendingIntentFlags.Immutable); NotificationManager manager = NotificationManager.FromContext(context); if (Build.VERSION.SdkInt >= BuildVersionCodes.O) { NotificationChannel notificationChannel = new NotificationChannel(CHANNEL_ID, "My Notifications", NotificationImportance.Max); // Configure the notification channel. notificationChannel.Description = "Channel description"; notificationChannel.EnableLights(true); notificationChannel.LightColor = Color.AliceBlue; notificationChannel.SetVibrationPattern(new long[] { 0, 1000, 500, 1000 }); notificationChannel.EnableVibration(true); manager.CreateNotificationChannel(notificationChannel); } Notification.Builder builder = new Notification.Builder(context, CHANNEL_ID) .SetContentTitle(title) .SetContentText(message) .SetSmallIcon(Resource.Drawable.icon); builder.SetContentIntent(pending); Notification notification = builder.Build(); manager.Notify(1337, notification); } } catch (Exception ex) { Log.Error("VERSION", ex.Message); } //PendingIntent pendingz = PendingIntent.GetBroadcast(context, 0, intent, PendingIntentFlags.UpdateCurrent); //AlarmManager alarmManager = context.GetSystemService(Context.AlarmService).JavaCast<AlarmManager>(); //alarmManager.SetExact(AlarmType.ElapsedRealtimeWakeup, SystemClock.ElapsedRealtime() + 10 * 1000, pendingz); }
/// <summary> /// Construct a new ConfigForm and initialize it with ConfigHelper. /// </summary> public ConfigForm() { InitializeComponent(); // Init texts from Resources startupLoadCheckBox.Text = Resources.ConfigStartupLoad; noTransparencyCheckBox.Text = Resources.ConfigNoTransparency; enableMpegCheckbox.Text = Resources.ConfigEnableMpeg; copyProviderBox.Text = Resources.ConfigCopyProvider; noUrlCopyCheckBox.Text = Resources.ConfigNoCopy; addProviderLabel.Text = Resources.ConfigAddProvider; removeProviderLabel.Text = Resources.ConfigRemoveProvider; manualScallingLabel.Text = Resources.ConfigManualScalling; updateLinkLabel.Text = Resources.ConfigUpdateLink; videoFpsLabel.Text = Resources.ConfigVideoFps; formatLabel.Text = Resources.ConfigFormat; noImageCopyCheckBox.Text = Resources.ConfigNoImageCopy; // Init checkboxes noUrlCopyCheckBox.Checked = ConfigService.Current.NoUrlCopy; noTransparencyCheckBox.Checked = ConfigService.Current.NoTransparency; enableMpegCheckbox.Checked = ConfigService.Current.EnableMpeg; startupLoadCheckBox.Checked = ConfigService.Current.StartupRegister; noImageCopyCheckBox.Checked = ConfigService.Current.NoImageCopy; // Init lists and boxes formatBox.Items.AddRange(Constants.ImageFormats.Keys.ToArray()); videoFpsBox.Items.AddRange(Constants.FpsList.ToArray()); videoFpsBox.Text = ConfigService.Current.SafeVideoFps.ToString(); urlToCopyBox.Text = ConfigService.Current.CopyProvider; formatBox.Text = ConfigService.Current.SafeImageExt; manualScallingBox.Text = string.Join(" ", ConfigService.Current.SafeManualScaling); // Set tooltips toolTip.SetToolTip(manualScallingBox, Resources.ConfigManualScallingHelp); // Show welcome message if this is the first launch of the app if (!ConfigService.Current.NoWelcome) { MessageBox.Show(Resources.WelcomeMessage, "SharpCrop"); ConfigService.Current.NoWelcome = true; } // Init version checker var url = VersionService.GetLatestLink(); if (url != null) { updateLinkLabel.LinkClicked += (s, e) => Process.Start(url); updateLinkLabel.Show(); } // Register an update event and update provider list ProviderService.RegisteredProvidersChanged += UpdateProviderList; ProviderService.LoadedProvidersChanged += UpdateProviderList; UpdateProviderList(); }
public IISSitesTests() { log = new mock.LogService(false); iis = new Mock.Clients.MockIISClient(log); helper = new IISHelper(log, iis); version = new VersionService(log); plugins = new mock.MockPluginService(log, version); userRoleService = new UserRoleService(iis); }
public IISBindingTests() { log = new Mock.Services.LogService(false); iis = new Mock.Clients.MockIISClient(log); helper = new IISHelper(log, iis); version = new VersionService(log); plugins = new MockPluginService(log, version); userRoleService = new Mock.Services.UserRoleService(); }
public ActionResult CheckValidName(string Id, string duAnID, string tenPhienBan) { var idVerSion = string.IsNullOrEmpty(Id) ? 0 : Convert.ToInt32(Id); var idProject = string.IsNullOrEmpty(duAnID) ? 0 : Convert.ToInt32(duAnID); var service = new VersionService(); var result = service.CheckValidName(idVerSion, idProject, tenPhienBan); return(Json(result, JsonRequestBehavior.AllowGet)); }
// this constructor is called from XAML - use fixed dependencies public MiningViewModel() { // enforce a minimum of ten seconds for the polling period var pollingPeriod = TimeSpan.FromSeconds(Math.Max(TimeSpan.FromSeconds(10).TotalSeconds, Settings.Default.MinerWatchdogPollingPeriod.TotalSeconds)); if (pollingPeriod != Settings.Default.MinerWatchdogPollingPeriod) { AddMessage(string.Format("Setting MinerWatchdogPollingPeriod to minimum polling period [{0}].", pollingPeriod)); } IController controller = null; ISummaryDataManager dataManager = null; if (!IsDesignMode) { var minerComms = new MinerCommunication(Settings.Default.MinerProcessName, Settings.Default.LaunchCommand, Settings.Default.ImportantProcessNames.Cast<string>()); controller = new Controller(minerComms, pollingPeriod); dataManager = new SummaryDataManager(Settings.Default.SaveInterval); } var idleTimeProvider = new IdleTimeProvider(); var windowController = new WindowController(); var conn = new Connection(new ProductHeaderValue(Title.Replace(" ", string.Empty))); var api = new ApiConnection(conn); var releasesClient = new ReleasesClient(api); var versionService = new VersionService(releasesClient, GitHubOwner, GitHubRepo); this.InitializeDesignTime(controller, idleTimeProvider, dataManager, windowController, versionService); }