public override int GetHashCode() { int hash = 1; if (AppName.Length != 0) { hash ^= AppName.GetHashCode(); } if (AppVersion.Length != 0) { hash ^= AppVersion.GetHashCode(); } if (AppChannel.Length != 0) { hash ^= AppChannel.GetHashCode(); } if (SdkVersion.Length != 0) { hash ^= SdkVersion.GetHashCode(); } hash ^= ExtensionInfo.GetHashCode(); if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public override int GetHashCode() { int hash = 1; if (AppName.Length != 0) { hash ^= AppName.GetHashCode(); } if (BuildVersion.Length != 0) { hash ^= BuildVersion.GetHashCode(); } if (MachineId.Length != 0) { hash ^= MachineId.GetHashCode(); } if (Bundle.Length != 0) { hash ^= Bundle.GetHashCode(); } if (_unknownFields != null) { hash ^= _unknownFields.GetHashCode(); } return(hash); }
public static string GetUrl(AppName appName) { string url = null; switch (appName) { case AppName.Jeopardy: //Consistent average response time 270ms url = "http://www.jservice.io/api/random"; break; case AppName.NumericTrivia: //Consistent average response time 330ms url = "http://numbersapi.com/random/trivia"; break; case AppName.TrumpQuotes: //Average response time 280ms but sometimes peaking around 370ms url = "https://api.tronalddump.io/random/quote"; break; //case AppName.ExchangeRates: // url = "http://api.fixer.io/latest"; // http://api.fixer.io/latest?symbols=USD,GBP&base=GBP // break; //case AppName.OpenTriviaDatabase: // url = "https://opentdb.com/api.php?amount=1&category=18&difficulty=easy&type=multiple"; //https://opentdb.com/api_config.php // break; //case AppName.QruisityApp: // url = "https://qriusity.com/v1/questions?page=2&limit=1"; // break; } return(url); }
public void rePresetFile() { if (AppName.Equals("Window") && !windowCheck) { Console.WriteLine("윈도우고 체크 활성아니니 실행"); windowCheck = true; } else if (!AppName.Equals("window")) { Console.WriteLine("윈도우아니니 체크 비활성"); windowCheck = false; } for (int i = 0; i < Payloads.Length; i++) { Payloads[i] = new DeviceData.Payload(); } render.initUI(); render.closeList(); render.listValueInit(); preset.getPresetFiles(); this.CurrentGroup = 0; render.updateUI(); render.resetImage(AppName); Console.WriteLine("변경된 그룹: " + this.CurrentGroup); this.groupChage = false; notice(this.AppName + " " + this.PresetName + " 프리셋으로 셋팅됨"); Console.WriteLine("-----스레드 끝-----"); }
public TriviaDialog(AppName appName, string optionsName) { this.appName = appName; this.optionsName = optionsName; InitializeComponent(); InitializeTriviaDialog(); }
/* * --------- * Overrides * --------- */ /* For maintaining consistency. */ public void CleanupConfig(string thisPath) { if (String.IsNullOrEmpty(AppName)) { AppName = "Reloaded Application Name"; } if (String.IsNullOrEmpty(AppId)) { AppId = AppName.Replace(" ", "."); } if (!String.IsNullOrEmpty(thisPath)) { string imagePath = Path.Combine(Path.GetDirectoryName(thisPath), AppIcon); if (!File.Exists(imagePath)) { AppIcon = ""; } } if (!File.Exists(AppLocation)) { AppLocation = ""; AppArguments = ""; } EnabledMods = ConfigCleanupUtility.FilterNonexistingModIds(EnabledMods).ToArray(); }
internal Uri GetIconUri(AppName appName) { var assemblyName = Assembly.GetExecutingAssembly().GetName(); var imageSubDirectory = appName.ToString(); var packUri = $"pack://application:,,,/{assemblyName.Name};component/Resources/{imageSubDirectory}/VsixExtensionIcon_16x16.png"; return(new Uri(packUri)); }
public HiddenOptionsDto ShowTrivia(AppName appName, string popUpTitle, DateTime lastPopUpDateTime, int popUpCountToday, int timeOutInMilliSeconds, string optionsName) { HiddenOptionsDto hiddenOptionsDto = null; var clientGateway = new ClientGateway(); var gatewayResponse = clientGateway.GetGatewayResponse(appName, timeOutInMilliSeconds, CommonConstants.TimeOutInMilliSecondsOptionLabel, optionsName); var somethingToShow = false; var triviaDialogDto = new TriviaDialogDto { AppName = appName, OptionsName = optionsName, PopUpTitle = popUpTitle }; if (!string.IsNullOrEmpty(gatewayResponse.ErrorDetails)) { triviaDialogDto.ErrorDetails = gatewayResponse.ErrorDetails; somethingToShow = !string.IsNullOrEmpty(triviaDialogDto.ErrorDetails); } else { switch (appName) { case AppName.Jeopardy: var gatewayResponseJeopardy = (GatewayResponseJeopardy)gatewayResponse; triviaDialogDto.Answer = "A. " + gatewayResponseJeopardy.Answer; triviaDialogDto.Question = "Q. " + gatewayResponseJeopardy.Question; somethingToShow = !string.IsNullOrEmpty(triviaDialogDto.Question); break; case AppName.NumericTrivia: var gatewayResponseNumeric = (GatewayResponseNumericTrivia)gatewayResponse; triviaDialogDto.Fact = gatewayResponseNumeric.NumericFact; somethingToShow = !string.IsNullOrEmpty(triviaDialogDto.Fact); break; case AppName.TrumpQuotes: var gatewayResponseTrump = (GatewayResponseTrumpQuotes)gatewayResponse; triviaDialogDto.HyperLinkUri = gatewayResponseTrump.HyperLinkUri; triviaDialogDto.Quotation = gatewayResponseTrump.TrumpQuote; triviaDialogDto.Attribution = gatewayResponseTrump.QuotationAuthor + spacer + gatewayResponseTrump.QuotationDate + spacer; somethingToShow = !string.IsNullOrEmpty(triviaDialogDto.Quotation); break; } } if (somethingToShow) { DisplayPopUpMessage(triviaDialogDto); hiddenOptionsDto = GetHiddenOptionsDto(lastPopUpDateTime, popUpCountToday); } return(hiddenOptionsDto); }
public Startup(IHostingEnvironment env) { var builder = new ConfigurationBuilder() .SetBasePath(env.ContentRootPath) .AddJsonFile("appsettings.json", optional: false, reloadOnChange: true) .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true) .AddEnvironmentVariables(); Configuration = builder.Build(); appName = AppName.UperHui; }
public async Task <ContentResult> Guest(AppName app_name) { var loginResult = await GuestLoginService.Login(GetRequestIpAddress(), new LoginContext() { AppName = app_name, LoginType = LoginType.guest, UserId = Guid.NewGuid().ToString(), }); return(Content(loginResult.ToJson(), "application/json")); }
/// <summary> /// See if this this <see cref="AppCastItem"/> version equals the version of another <see cref="AppCastItem"/>. /// Also checks to make sure the application names match. /// </summary> /// <param name="obj">the instance to compare to</param> /// <returns></returns> public override bool Equals(object obj) { if (!(obj is AppCastItem item)) { return(false); } if (ReferenceEquals(this, item)) { return(true); } return(AppName.Equals(item.AppName) && CompareTo(item) == 0); }
public override int GetHashCode() { unchecked { var hashCode = (AppName != null ? AppName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AppLocation != null ? AppLocation.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AppArguments != null ? AppArguments.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AppIcon != null ? AppIcon.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (EnabledMods != null ? EnabledMods.GetHashCode() : 0); return(hashCode); } }
public void Validate() { if (AppName._IsEmpty()) { throw new ArgumentNullException(nameof(AppName)); } if (this.DefaultCommitId._IsFilled() && this.DefaultCommitId._GetHexBytes().Length != 20) { throw new ArgumentException(nameof(DefaultCommitId)); } }
/// <summary> /// Преобразует биндинг в префикс листенера /// </summary> /// <returns></returns> public override string ToString() { if (!AppName.EndsWith("/")) { AppName += "/"; } if (!AppName.StartsWith("/")) { AppName = "/" + AppName; } return(Schema.ToString().ToLower() + "://" + Interface + ":" + Port + AppName); }
public ShellViewModel(AppName appName, ApplicationSettings settings, INavigationService navigationService, IHub hub) { _appName = appName; _settings = settings; _navigationService = navigationService; _hub = hub; Message = "Initializing..."; IsLoading = true; BackCommand = _navigationService.GoBackCommand; }
private void HandleQueryApp(string param) { //has children CurrentApps.Clear(); string match = AppName.Trim().Replace("*", "%"); //get entity from cache IEnumerable <App> dataQuery = DbContext.SearcyAppByName(match); CurrentApps.Load(dataQuery); }
private static AppKey ensureAppKeyIsValid(IServiceProvider sp) { var options = sp.GetService <IOptions <BuildOptions> >().Value; if (string.IsNullOrWhiteSpace(options.AppName)) { throw new ArgumentException("App Name is Required"); } var appName = new AppName(options.AppName); return(new AppKey(appName, AppType.Values.WebApp)); }
public void DistributeImagesWait(int MaxRetries) { string AwsArgs = Deployment2AwsArgs(Region: "NONE"); string GceArgs = Deployment2GceArgs(Zone: "us-central-1c", Region: "NONE"); string GceLiveArgs = Deployment2GceArgs(Zone: "us-central1-c", Region: "NONE", AppNameStringOverride: "UnrealTournamentDev"); CommandUtils.Log("Waiting for VM image creation in {0} to complete", AppName.ToString()); if (AppName != UnrealTournamentBuild.UnrealTournamentAppName.UnrealTournamentDev) { Deployment2Command("image_create", GceLiveArgs, "get_pending", MaxRetries); } Deployment2Command("image_create", GceArgs, "get_pending", MaxRetries); Deployment2Command("image_create", AwsArgs, "get_pending", MaxRetries); }
public override int GetHashCode() { unchecked { var hashCode = Priority != null?Priority.GetHashCode() : 0; hashCode = (hashCode * 397) ^ Version.GetHashCode(); hashCode = (hashCode * 397) ^ EventTime.GetHashCode(); hashCode = (hashCode * 397) ^ (Hostname != null ? Hostname.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (AppName != null ? AppName.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (ProcessId != null ? ProcessId.GetHashCode() : 0); hashCode = (hashCode * 397) ^ (MessageId != null ? MessageId.GetHashCode() : 0); return(hashCode); } }
private void DGridAppNames_SelectionChanged(object sender, SelectionChangedEventArgs e) { try { if (DGridAppNames.SelectedItem == null) { return; } var x = new AppName { _App = (DGridAppNames.SelectedItem as AppName)._App, _PathEXE = (DGridAppNames.SelectedItem as AppName)._PathEXE, _LatestVersion = (DGridAppNames.SelectedItem as AppName)._LatestVersion, _Path_Latest_Installer = (DGridAppNames.SelectedItem as AppName)._Path_Latest_Installer, _MSI_Installer = (DGridAppNames.SelectedItem as AppName)._MSI_Installer, _EXE_Installer = (DGridAppNames.SelectedItem as AppName)._EXE_Installer, _PublishTo = (DGridAppNames.SelectedItem as AppName)._PublishTo }; TxtAppName.Text = x._App; TxtPathExe.Text = x._PathEXE; TxtLatestVersion.Text = x._LatestVersion; TxtPathInstaller.Text = x._Path_Latest_Installer; TxtMSI.Text = x._MSI_Installer; TxtEXE.Text = x._EXE_Installer; int index = -1; foreach (ComboBoxItem cboitem in CboPublishTo.Items) { var newcboitem = new ComboBoxItem() { Content = x._PublishTo.Equals("") ? "ANY" : x._PublishTo }; index++; if (cboitem.Content.ToString().Equals(newcboitem.Content.ToString(), StringComparison.OrdinalIgnoreCase)) { CboPublishTo.SelectedIndex = index; break; } } } catch (Exception ex) { MessageBox.Show("Error : " + ex.Message, "Apps Center", MessageBoxButton.OK, MessageBoxImage.Error); return; } }
public static void Shutdown(AppName appName) { ClearTempFolders(); switch (appName) { case AppName.Reporter: break; case AppName.Viewer: break; case AppName.Templater: break; } }
private void TryProcessUnknown() { string AppName; using (MySqlDataReader MainReader = DbWorker.ExecuteReader("SELECT `Name` FROM `Apps` WHERE `AppID` = @AppID LIMIT 1", new MySqlParameter("AppID", AppID))) { if (!MainReader.Read()) { return; } AppName = DbWorker.GetString("Name", MainReader); } bool historyChanged = false; using (MySqlDataReader Reader = DbWorker.ExecuteReader("SELECT `Name`, `Key`, `Value` FROM `AppsInfo` INNER JOIN `KeyNames` ON `AppsInfo`.`Key` = `KeyNames`.`ID` WHERE `AppID` = @AppID", new MySqlParameter("AppID", AppID))) { while (Reader.Read()) { if (!DbWorker.GetString("Name", Reader).StartsWith("website", StringComparison.Ordinal)) { MakeHistory("removed_key", Reader.GetUInt32("Key"), DbWorker.GetString("Value", Reader)); historyChanged = true; } } } DbWorker.ExecuteNonQuery("DELETE FROM `Apps` WHERE `AppID` = @AppID", new MySqlParameter("@AppID", AppID)); DbWorker.ExecuteNonQuery("DELETE FROM `AppsInfo` WHERE `AppID` = @AppID", new MySqlParameter("@AppID", AppID)); DbWorker.ExecuteNonQuery("DELETE FROM `Store` WHERE `AppID` = @AppID", new MySqlParameter("@AppID", AppID)); if (!AppName.StartsWith(SteamDB.UNKNOWN_APP, StringComparison.Ordinal)) { MakeHistory("deleted_app", 0, AppName); historyChanged = true; } // TODO: This is a dirty hack so we somehow track these app changes if (!historyChanged && !Settings.IsFullRun) { MakeHistory("removed_key", GetKeyNameID("root_change_number"), "0", "0"); } }
protected override void Execute(CodeActivityContext codeActivityContext) { // Set up ITracingService, IOrganizationService. ITracingService tracingService = codeActivityContext.GetExtension <ITracingService>(); IWorkflowContext context = codeActivityContext.GetExtension <IWorkflowContext>(); IOrganizationServiceFactory serviceFactory = codeActivityContext.GetExtension <IOrganizationServiceFactory>(); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); // Read InArguments. string recordUrl = RecordUrl.Get <string>(codeActivityContext); string appName = AppName.Get(codeActivityContext); // Create URL. string newRecordUrl = GenerateUrlForApp(service, recordUrl, appName); // Set OutArgument. NewRecordUrl.Set(codeActivityContext, newRecordUrl); }
public GatewayResponseBase GetGatewayResponse(AppName appName, int timeOutInMilliSeconds, string timeOutInMilliSecondsOptionLabel, string optionName) { var url = AppUrlHelper.GetUrl(appName); var gatewayResponse = new GatewayResponseBase(); if (!string.IsNullOrEmpty(url)) { var responseDto = GetRestResponse(url, timeOutInMilliSeconds, timeOutInMilliSecondsOptionLabel, optionName); if (!string.IsNullOrEmpty(responseDto.ErrorDetails)) { SetGatewayResponseFromErrorDetails(gatewayResponse, responseDto.ErrorDetails); } else { try { switch (appName) { case AppName.Jeopardy: gatewayResponse = ClientGatewayJeopardy.SetGatewayResponseFromRestResponse(responseDto.ResponseContent); break; case AppName.NumericTrivia: gatewayResponse = ClientGatewayNumericTrivia.SetGatewayResponseFromRestResponse(responseDto.ResponseContent); break; case AppName.TrumpQuotes: gatewayResponse = ClientGatewayTrumpQuotes.SetGatewayResponseFromRestResponse(responseDto.ResponseContent); break; } } catch (Exception ex) { HandleUnexpectedError(ex, responseDto); SetGatewayResponseFromErrorDetails(gatewayResponse, responseDto.ErrorDetails); } } } return(gatewayResponse); }
public override void Run(List <Variable> variableList) { var fileMaker = new NgFileMaker(); var app = AppName.Replace(@"\", @"").Replace(@".app", @""); Console.Write($@"Install app {app} ... "); foreach (var variable in variableList) { AppName = AppName.Replace("@(" + variable.Name + ")", variable.Value); FileName = FileName.Replace("@(" + variable.Name + ")", variable.Value); WorkingDirectory = WorkingDirectory.Replace("@(" + variable.Name + ")", variable.Value); } FileName = Environment.ExpandEnvironmentVariables(FileName); WorkingDirectory = Environment.ExpandEnvironmentVariables(WorkingDirectory); var appUninstallLoc = new System.IO.DirectoryInfo($@"/Applications/{AppName}"); fileMaker.DeleteFolder(appUninstallLoc); var process = new Process(); process.StartInfo.WorkingDirectory = WorkingDirectory; process.StartInfo.FileName = @$ "/bin/bash"; process.StartInfo.Arguments = $@"-c ""mv {FileName} /Applications/{AppName.Replace(@" ", @"\ ")}"""; process.StartInfo.Verb = "runas"; process.Start(); process.WaitForExit(); process = new Process(); process.StartInfo.WorkingDirectory = WorkingDirectory; process.StartInfo.FileName = @$ "/bin/bash"; process.StartInfo.Arguments = $@"-c ""xattr -cr /Applications/{AppName.Replace(@" ", @"\ ")}"""; process.StartInfo.Verb = "runas"; process.Start(); process.WaitForExit(); Console.WriteLine("Done"); }
void OpenApp(AppName type) { switch (type) { case AppName.Discovery: Intent.launchApp("com.templegatesgames.DiscoveryGear"); break; case AppName.BBC: Intent.launchApp("uk.co.bbc.vr"); break; case AppName.Within: Intent.launchApp("com.shakingearthdigital.vrse"); break; case AppName.Jaint: Intent.launchApp("com.jauntvr.android.player.gearvr"); break; case AppName.RedBull: //Intent.launchApp("com.nousguide.android.rbtv"); Intent.launchApp("com.oculus.tv"); break; case AppName.Disney: Intent.launchApp("com.disney.dmvr"); break; case AppName.CNN: Intent.launchApp("com.mobile.cnnvr"); break; case AppName.NewYorkTimes: Intent.launchApp("co.vusr.nytvr.gearvr"); break; case AppName.Yoga: Intent.launchApp("com.CubicleNinjas.GMVRMobile"); break; } }
public void DistributeImagesAsync() { string AwsArgs = Deployment2AwsArgs(Region: "NONE"); string GceArgs = Deployment2GceArgs(Zone: "us-central1-c", Region: "NONE"); string GceLiveArgs = Deployment2GceArgs(Zone: "us-central1-c", Region: "NONE", AppNameStringOverride: "UnrealTournamentDev"); CommandUtils.Log("Uploading build {0} to s3", BuildString); if (Debug == false) { DeployLinuxServerS3(BuildString); } CommandUtils.Log("Creating VM image in {0} for build {1}", AppName.ToString(), BuildString); if (AppName != UnrealTournamentBuild.UnrealTournamentAppName.UnrealTournamentDev) { Deployment2Command("image_create", GceLiveArgs, "true", 1); } Deployment2Command("image_create", GceArgs, "true", 1); Deployment2Command("image_create", AwsArgs, "true", 1); }
}//end load user list /// <summary> /// this method is for appList which will fill the text values based on the select indexs for apps /// </summary> /// <param name="sender">sender object</param> /// <param name="e">argument e</param> private void AppList_SelectedIndexChanged(object sender, EventArgs e) { App selectedApp = (App)AppList.SelectedValue; if (selectedApp.ApplicationID != 0) { AppID.Enabled = true; AppID.Text = selectedApp.ApplicationID.ToString(); AppName.Text = selectedApp.ApplicationName; AppVersion.Text = selectedApp.ApplicationVersion; AppDesc.Text = selectedApp.ApplicationDescription; } else { AppID.Enabled = false; AppID.Text = selectedApp.ApplicationID.ToString(); AppName.Clear(); AppVersion.Clear(); AppDesc.Clear(); } }//end applist
private static AppKey ensureAppKeyIsValid(IServiceProvider sp) { var options = sp.GetService <IOptions <InstallOptions> >().Value; if (string.IsNullOrWhiteSpace(options.AppName)) { throw new ArgumentException("App Name is Required"); } if (string.IsNullOrWhiteSpace(options.AppType)) { throw new ArgumentException("App Type is Required"); } var appName = new AppName(options.AppName); var appType = AppType.Values.Value(options.AppType); if (appType.Equals(AppType.Values.NotFound)) { throw new ArgumentException($"App Type '{options.AppType}' is not valid"); } return(new AppKey(appName, appType)); }
static void RunApp(string[] args) { var shouldStartService = args.Any(x => "-StartService".Equals(x, StringComparison.InvariantCultureIgnoreCase)); var settingsStore = new InMemoryKeyValueCache(new RegistryKeyValueStore(AppName)); var logBuffer = new RotatingBufferSink(); InitializeLogging(logBuffer, settingsStore, defaultLogLevel: LogLevel.Info); Log.Info($"Running version: {AppVersion}"); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); var retryLogic = new ExponentialBackoffLogic(min: TimeSpan.FromMilliseconds(10), max: TimeSpan.FromHours(1)); var startupRegistration = new StartupFolderRegistration( AppName.ToLowerInvariant(), new ShortcutOptions { Arguments = "-StartService", Target = AppPath }, WindowsScriptHostWrapper.CreateShortcut, ShellifyWrapper.ReadShortcut); using (var scheduler = new WorkScheduler(retryLogic.CalculateRetryAfter)) { var service = new WatchForFilesToDelete <string>( subjectFactory: () => CreateSubject(settingsStore), delete: Shell32Delete.DeleteFile, scheduler: scheduler); RunForm(new MainForm( showSettingsForm: !shouldStartService, appPath: AppPath, logEntries: logBuffer, openWindowMessage: (int)User32Messages.GetMessage(Constants.OpenWindowMessage), settingsStore: settingsStore, startService: service.Run, startupRegistration: startupRegistration)); } }