private async void OpenExeFolderButton_OnClick(object sender, RoutedEventArgs e) { try { var filePath = FileSavePath.Text.Trim(); if (string.IsNullOrEmpty(filePath)) { return; } var folderPath = System.IO.Path.GetDirectoryName(filePath); if (await GlobalObjects.DirectoryExists(folderPath)) { Process.Start("explorer", folderPath); } else { MessageBox.Show("Directory path does not exist."); } } catch (Exception ex) { LogErrorMessage(ex); } }
private async void BuildFilePath_OnTextChanged(object sender, TextChangedEventArgs e) { try { var enabled = false; var openFolderEnabled = false; if (BuildFilePath.Text.Length > 0) { var match = Regex.Match(BuildFilePath.Text, @"^\w:\\|\\\\.*\\..*"); if (match.Success) { enabled = true; var folderExists = await GlobalObjects.DirectoryExists(BuildFilePath.Text); if (!folderExists) { folderExists = await GlobalObjects.DirectoryExists(BuildFilePath.Text); } openFolderEnabled = folderExists; } } OpenFolderButton.IsEnabled = openFolderEnabled; } catch (Exception ex) { LogErrorMessage(ex); } finally { EnableGenerateButton(); } }
private async void BuildFilePath_OnTextChanged(object sender, TextChangedEventArgs e) { try { var enabled = false; var openFolderEnabled = false; if (ProductUpdateSource.Text.Trim().Length > 0) { var match = Regex.Match(ProductUpdateSource.Text, @"^\w:\\|\\\\.*\\..*"); if (match.Success) { enabled = true; var folderExists = await GlobalObjects.DirectoryExists(ProductUpdateSource.Text); if (!folderExists) { folderExists = await GlobalObjects.DirectoryExists(ProductUpdateSource.Text); } openFolderEnabled = folderExists; } } OpenFolderButton.IsEnabled = openFolderEnabled; DownloadButton.IsEnabled = enabled; } catch (Exception ex) { LogErrorMessage(ex); } }
private void cmdDisconnect_Click(object sender, EventArgs e) { foreach (ListViewItem item in lvwUsers.SelectedItems) { var index = int.Parse(item.Text); GlobalObjects.Users.Destroy(GlobalObjects.GetUser(index)); lvwUsers.Items.Remove(item); } }
private void cmdStart_Click(object sender, EventArgs e) { cmdShowUsers.Enabled = true; cmdStop.Enabled = true; cmdStart.Enabled = false; lblStatus.Text = "Server Open"; tmrUpdateUI.Start(); GlobalObjects.EntryPoint(); }
// Use this for initialization void Start() { theGlobalObjects = FindObjectOfType <GlobalObjects> (); myRigidbody = GetComponent <Rigidbody2D> (); RuntimeAnimatorController theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run5"); if (theGlobalObjects.selectChar1) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run1"); } else if (theGlobalObjects.selectChar2) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run2"); } else if (theGlobalObjects.selectChar3) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run4"); } else if (theGlobalObjects.selectChar4) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run3"); } else if (theGlobalObjects.selectChar5) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run5"); } else if (theGlobalObjects.selectChar6) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Run6"); } playerAnimator = GetComponent <Animator>(); playerAnimator.runtimeAnimatorController = theAnimController; gameObject.transform.position = startPosition; Vector3 position = gameObject.transform.position; Quaternion rotation = gameObject.transform.rotation; Vector3 velocity = myRigidbody.velocity; playerAnimator.runtimeAnimatorController = theAnimController; gameObject.transform.position = position; myRigidbody.velocity = velocity; transform.rotation = rotation; theCheckpoint = GameObject.FindGameObjectWithTag("Checkpoint"); respawnPosition = theCheckpoint.transform.position; theGameManager = FindObjectOfType <GameManager> (); myCollider = GetComponent <Collider2D> (); myAnimator = GetComponent <Animator> (); }
void Start() { GlobalObjects go = GameObject.FindGameObjectWithTag("Globals").GetComponent <GlobalObjects>(); playerName = go.DialogueCanvas.transform.Find("Panel").transform.Find("PlayerName").GetComponent <Text>(); npcName = go.DialogueCanvas.transform.Find("Panel").transform.Find("NPCName").GetComponent <Text>(); dialogueText = go.DialogueCanvas.transform.Find("Panel").transform.Find("DialogueText").GetComponent <Text>(); playerBust = go.DialogueCanvas.transform.Find("Panel").transform.Find("PlayerBust").GetComponent <Image>(); npcBust = go.DialogueCanvas.transform.Find("Panel").transform.Find("NPCBust").GetComponent <Image>(); }
void Start() { translatorButton = GameObject.Find("TranslatorButton"); translatorPanel = GameObject.Find("TranslatorPanel"); conjugatorButton = GameObject.Find("ConjugatorButton"); conjugatorPanel = GameObject.Find("ConjugatorPanel"); theGlobalObjects = FindObjectOfType <GlobalObjects> (); translatorPanel.gameObject.SetActive(false); conjugatorPanel.gameObject.SetActive(false); }
void Start() { theGlobalObjects = FindObjectOfType <GlobalObjects> (); difficultyDropdown = GameObject.Find("DifficultyDropdown").GetComponent <UnityEngine.UI.Dropdown>(); verbTypeDropdown = GameObject.Find("VerbTypeDropdown").GetComponent <UnityEngine.UI.Dropdown>(); verbTenseDropdown = GameObject.Find("VerbTenseDropdown").GetComponent <UnityEngine.UI.Dropdown>(); difficulty = difficultyDropdown.captionText.text; type = verbTypeDropdown.captionText.text; tense = verbTenseDropdown.captionText.text; }
// Start is called before the first frame update void Start() { GlobalObjects go = GameObject.FindGameObjectWithTag("Globals").GetComponent <GlobalObjects>(); TextMeshProUGUI t = go.SignCanvas.transform.GetComponentInChildren <TextMeshProUGUI>(); if (t != null) { MessageText = t; t.text = LastMessage; } }
// Use this for initialization void Start() { musicTitle = GlobalObjects.getInstance().StringParam; _audioSource = GameObject.Find("GameMusic").GetComponent <AudioSource> (); _audioSource.clip = Resources.Load("Musics/" + musicTitle) as AudioClip; _timing = new float[1024]; _lineNum = new int[1024]; LoadCSV(); StartGame(); timeOrigin = Time.time; }
public void Awake() { if (sharedInstance == null) { Debug.Log("Awake GlobalObject"); sharedInstance = this; DontDestroyOnLoad(gameObject); } Debug.Log("StringParam = " + getInstance().StringParam); }
// Public Methods public NPC(string n, GameObject go, MapObject map, GlobalObjects globals) { name = n; gameObject = go; animator = go.GetComponent <SpriteAnimator>(); animator.SetSpriteRenderer(go.GetComponent <SpriteRenderer>()); pathFinder = go.GetComponent <PathFinder>(); grid = GameObject.FindGameObjectWithTag("Grid").GetComponent <Grid>(); globalObjects = globals; currentMap = map; globals.GetComponent <DialogueController>().LoadNPCConversation(n); }
void Start() { theGlobalObjects = FindObjectOfType <GlobalObjects> (); myRigidbody = GetComponent <Rigidbody2D> (); RuntimeAnimatorController theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player6"); if (theGlobalObjects.selectChar1) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player6"); } else if (theGlobalObjects.selectChar2) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player3"); } else if (theGlobalObjects.selectChar3) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player4"); } else if (theGlobalObjects.selectChar4) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player5"); } else if (theGlobalObjects.selectChar5) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player2"); } else if (theGlobalObjects.selectChar6) { theAnimController = (RuntimeAnimatorController)Resources.Load("Animations/Player1"); } playerAnimator = GetComponent <Animator>(); playerAnimator.runtimeAnimatorController = theAnimController; gameObject.transform.position = startPosition; Vector3 position = gameObject.transform.position; Quaternion rotation = gameObject.transform.rotation; Vector3 velocity = myRigidbody.velocity; playerAnimator.runtimeAnimatorController = theAnimController; gameObject.transform.position = position; myRigidbody.velocity = velocity; transform.rotation = rotation; this.originalY = this.transform.position.y; this.originalX = this.transform.position.x; }
private async void IncludeBuild_OnChecked(object sender, RoutedEventArgs e) { try { var enabled = IncludeBuild.IsChecked.HasValue && IncludeBuild.IsChecked.Value; SourceFilePath.Visibility = enabled ? Visibility.Visible : Visibility.Collapsed; SourcePathLabel.IsEnabled = enabled; BuildFilePath.IsEnabled = enabled; BrowseSourcePathButton.IsEnabled = enabled; OpenFolderButton.IsEnabled = enabled; var buildFilePath = BuildFilePath.Text.Trim(); if (enabled && !string.IsNullOrEmpty(buildFilePath)) { if (await GlobalObjects.DirectoryExists(buildFilePath)) { OpenFolderButton.IsEnabled = true; } else { OpenFolderButton.IsEnabled = false; } } else { OpenFolderButton.IsEnabled = false; } if (SignInstaller.IsChecked.HasValue && SignInstaller.IsChecked.Value) { SpacerRow.Height = new GridLength(64, GridUnitType.Pixel); } else { SpacerRow.Height = new GridLength(114, GridUnitType.Pixel); } } catch (Exception ex) { LogErrorMessage(ex); } finally { EnableGenerateButton(); } }
public static NPC CreateNPC(string npcName, string modelName, float x, float y, MapObject map) { GameObject sprite = Instantiate(Resources.Load <GameObject>("Characters/" + modelName)); sprite.tag = "NPC"; sprite.name = "NPC_" + npcName; sprite.layer = LayerMask.NameToLayer("Player & NPC"); // Add Animation Sprites to NPC object SpriteAnimator anim = sprite.GetComponent <SpriteAnimator>(); anim.Initialise(); SpriteRenderer renderer = sprite.GetComponent <SpriteRenderer>(); renderer.sortingOrder = (int)((map.MapHeight - y) * 100); renderer.transform.position = new Vector3(x, y, -0.09f); renderer.transform.localScale = new Vector3(1, 1, 1); renderer.sprite = anim.Sprites[1]; // Add Pathfinder to NPC sprite.AddComponent <PathFinder>(); // Add Polygon Collider and Rigid Body Rigidbody2D rb = sprite.AddComponent <Rigidbody2D>(); rb.bodyType = RigidbodyType2D.Dynamic; rb.freezeRotation = true; PolygonCollider2D pc = sprite.AddComponent <PolygonCollider2D>(); pc.isTrigger = true; // Add Box Collider for interactions BoxCollider2D bc = sprite.AddComponent <BoxCollider2D>(); bc.isTrigger = true; // Add Collision Controller sprite.AddComponent <CollisionController>(); // Return NPC GlobalObjects globalObjects = GameObject.FindGameObjectWithTag("Globals").GetComponent <GlobalObjects>(); return(new NPC(npcName, sprite, map, globalObjects)); }
void Awake() { Instance = this; List <FarmTile> tiles = new List <FarmTile>(); foreach (var pos in FarmTilemap.cellBounds.allPositionsWithin) { var curTile = FarmTilemap.GetTile <FarmTile>(pos); if (curTile == null) { continue; } curTile.cropObj = MakeFarmPlot(pos); } }
// Use this for initialization void Start() { theGlobalObjects = FindObjectOfType <GlobalObjects> (); selected1 = GameObject.Find("ChoiceButton/Selected"); selected2 = GameObject.Find("ChoiceButton2/Selected"); selected3 = GameObject.Find("ChoiceButton3/Selected"); selected4 = GameObject.Find("ChoiceButton4/Selected"); selected5 = GameObject.Find("ChoiceButton5/Selected"); selected6 = GameObject.Find("ChoiceButton6/Selected"); selected1.SetActive(false); selected2.SetActive(false); selected3.SetActive(false); selected4.SetActive(false); selected5.SetActive(false); selected6.SetActive(false); if (theGlobalObjects.selectChar1 == true) { selected1.SetActive(true); } else if (theGlobalObjects.selectChar2 == true) { selected2.SetActive(true); } else if (theGlobalObjects.selectChar3 == true) { selected3.SetActive(true); } else if (theGlobalObjects.selectChar4 == true) { selected4.SetActive(true); } else if (theGlobalObjects.selectChar5 == true) { selected5.SetActive(true); } else if (theGlobalObjects.selectChar6 == true) { selected6.SetActive(true); } }
private async Task UpdateVersions() { var branch = (OfficeBranch)UpdateBranch.SelectedItem; if (branch == null) { return; } UpdateTargetVersion.ItemsSource = branch.Versions; UpdateTargetVersion.SetValue(TextBoxHelper.WatermarkProperty, branch.CurrentVersion); var officeEdition = OfficeEdition.Office32Bit; var configXml = GlobalObjects.ViewModel.ConfigXmlParser.ConfigurationXml; if (configXml.Add != null) { if (configXml.Add.OfficeClientEdition == OfficeClientEdition.Office64Bit) { officeEdition = OfficeEdition.Office64Bit; } } if (UpdateUpdatePath.Text.Length > 0) { var otherFolder = GlobalObjects.SetBranchFolderPath(branch.Branch.ToString(), UpdateUpdatePath.Text); if (await GlobalObjects.DirectoryExists(otherFolder)) { if (!string.IsNullOrEmpty(UpdateUpdatePath.Text)) { UpdateUpdatePath.Text = GlobalObjects.SetBranchFolderPath(branch.Branch.ToString(), UpdateUpdatePath.Text); } } } await GetBranchVersion(branch, officeEdition); }
private async void OpenFolderButton_OnClick(object sender, RoutedEventArgs e) { try { var folderPath = ProductUpdateSource.Text.Trim(); if (string.IsNullOrEmpty(folderPath)) { return; } if (await GlobalObjects.DirectoryExists(folderPath)) { Process.Start("explorer", folderPath); } else { MessageBox.Show("Directory path does not exist."); } } catch (Exception ex) { LogErrorMessage(ex); } }
private void Start() { Globals = GameObject.FindGameObjectWithTag("Globals").GetComponent <GlobalObjects>(); }
// Use this for initialization void Start() { theGameManager = FindObjectOfType <GameManager> (); theGlobalObjects = FindObjectOfType <GlobalObjects> (); }
private void CreateMaterial() { material = new Material(GlobalObjects.GetObject <Material>("ChunkMaterial")); material.mainTexture = Texture; }
public void execLoadLevelWithString(string stringParam) { GlobalObjects.LoadLevelWithString("GameScene", stringParam); }
/// <summary> /// Saves the changed settings /// </summary> /// <param name="isSite">Indicates whether changed settings is global or site</param> private void Save(bool isSite) { // This action is permitted only for global administrators if (MembershipContext.AuthenticatedUser.IsGlobalAdministrator) { if (!String.IsNullOrEmpty(SettingsKeys)) { String[] keys = SettingsKeys.Split(';'); foreach (String key in keys) { if (key != String.Empty) { String objectKey = ";" + key + ";"; String siteKeyName = SiteName + "." + key; bool globalObject = (GlobalObjects.Contains(objectKey) || KeyScope == DisabledModuleScope.Global); bool siteObject = SiteObjects.Contains(objectKey); // If setting is global or site (or both), set global(site) settings no matter what button (site or global) was clicked if (globalObject || siteObject) { if (globalObject) { if (!SettingsKeyInfoProvider.GetBoolValue(key)) { SettingsKeyInfoProvider.SetValue(key, true); } } if (siteObject) { if (!SettingsKeyInfoProvider.GetBoolValue(siteKeyName)) { SettingsKeyInfoProvider.SetValue(siteKeyName, true); } } continue; } // Test first if settings is disabled if (!SettingsKeyInfoProvider.GetBoolValue(siteKeyName)) { String keyName = isSite ? siteKeyName : key; try { SettingsKeyInfoProvider.SetValue(keyName, true); } catch (Exception) { if (isSite) { // Site settings does not exists. Save as global then SettingsKeyInfoProvider.SetValue(key, true); } } // If global enabled and site still disabled - enable it also if (!isSite && (KeyScope != DisabledModuleScope.Global)) { // If settings not enabled, inherit from global if (!SettingsKeyInfoProvider.GetBoolValue(siteKeyName)) { SettingsKeyInfoProvider.SetValue(siteKeyName, null); } } } } } } // Reload UI if necessary if (ReloadUIWhenModuleEnabled) { URLHelper.Redirect(RequestContext.CurrentURL); } } }
// Use this for initialization void Start () { irishFromDatabase = new ArrayList(); englishFromDatabase = new ArrayList(); threeEnglish = new string[3]; threeIrish = new string[3]; theMixedPanel = GameObject.Find ("MixedTextPanel"); theIrishPanel = GameObject.Find ("IrishTextPanel"); theGlobalObjects = FindObjectOfType<GlobalObjects> (); easy = theGlobalObjects.easy; if (easy) { platformSpawnerResetPos = new Vector3(4.2f, -1.15f, 0f); } else { platformSpawnerResetPos = new Vector3(0.074f, -1.15f, 0f); } presentTense = theGlobalObjects.present; pastTense = theGlobalObjects.past; futureTense = theGlobalObjects.future; mixedTense = theGlobalObjects.mixed; regular = theGlobalObjects.regular; irregular = theGlobalObjects.irregular; if (easy) { secondsLeft = 8.0f; theIrishPanel.gameObject.SetActive (false); } else { countdownObject.gameObject.SetActive (false); } scoreText.text = scoreCount.ToString(); myRigidbody = GetComponent<Rigidbody2D> (); btn1 = Button1.GetComponent<UnityEngine.UI.Button>(); btn2 = Button2.GetComponent<UnityEngine.UI.Button>(); btn3 = Button3.GetComponent<UnityEngine.UI.Button>(); btn1.onClick.AddListener(CheckButton1); btn2.onClick.AddListener(CheckButton2); btn3.onClick.AddListener(CheckButton3); pointOfChangeReached = true; changeQuestion = true; if (mixedTense && theGlobalObjects.bothVerbTypes == true) { sqlQuery = "SELECT Irish,English FROM Verbs"; Debug.Log ("1"); } else if (presentTense && theGlobalObjects.bothVerbTypes == true) { Debug.Log ("2"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%present%'"; } else if (futureTense && theGlobalObjects.bothVerbTypes == true) { Debug.Log ("3"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%future%'"; } else if(pastTense && theGlobalObjects.bothVerbTypes == true) // { Debug.Log ("4"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%past%'"; } else if (mixedTense && theGlobalObjects.regular == true) { Debug.Log ("5"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.type like 'regular'"; } else if (mixedTense && theGlobalObjects.irregular == true) { Debug.Log ("6"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.type like '%irregular%'"; } else if (presentTense && theGlobalObjects.regular == true) { Debug.Log ("7"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%present%' AND Verbs.type like '%regular%'"; } else if (futureTense && theGlobalObjects.regular == true) { Debug.Log ("8"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%future%' AND Verbs.type like '%regular%'"; } else if(pastTense && theGlobalObjects.regular == true) //pastTense { Debug.Log ("9"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%past%' AND Verbs.type like '%regular%'"; } else if (mixedTense && theGlobalObjects.irregular == true) { Debug.Log ("10"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.type like '%irregular%'"; } else if (presentTense && theGlobalObjects.irregular == true) { Debug.Log ("11"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%present%' AND Verbs.type like '%irregular%'"; } else if (futureTense && theGlobalObjects.irregular == true) { Debug.Log ("12"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%future%' AND Verbs.type like '%irregular%'"; } else if(pastTense && theGlobalObjects.irregular == true) //pastTense { Debug.Log ("13"); sqlQuery = "SELECT Irish,English FROM Verbs WHERE Verbs.tense like '%past%' AND Verbs.type like '%irregular%'"; } OpenDB (p); using (IDbCommand dbcmd = dbcon.CreateCommand ()) { dbcmd.CommandText = sqlQuery; using (IDataReader reader = dbcmd.ExecuteReader ()) { while (reader.Read ()) { irishFromDatabase.Add (reader.GetString (0)); englishFromDatabase.Add (reader.GetString (1)); } } } if (easy) { option1.gameObject.SetActive (false); option2.gameObject.SetActive (false); option3.gameObject.SetActive (false); Button1.gameObject.SetActive (false); Button2.gameObject.SetActive (false); Button3.gameObject.SetActive (false); } }
static void Main(string[] args) { Filesystem fsChecks = new Filesystem(); Generic.SandboxRes fsRes1 = fsChecks.checkFiles(); Console.WriteLine("[+] Filesystem detection methods"); Console.WriteLine(" [-] Check if specific files exist"); Console.WriteLine(" [*] Is sandbox? " + fsRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in fsRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes fsRes2 = fsChecks.checkDirectories(); Console.WriteLine(" [-] Check if specific directories are present"); Console.WriteLine(" [*] Is sandbox? " + fsRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in fsRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes fsRes3 = fsChecks.checkExePath(); Console.WriteLine(" [-] Check if full path to the executable contains one of the specific strings &\n" + " Check if the executable is run from specific directory"); Console.WriteLine(" [*] Is sandbox? " + fsRes3.isSandbox.ToString()); foreach (Generic.SandboxTag tag in fsRes3.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes fsRes4 = fsChecks.checkExeRoot(); Console.WriteLine(" [-] Check if the executable files with specific names are present in physical disk drives' root"); Console.WriteLine(" [*] Is sandbox? " + fsRes4.isSandbox.ToString()); foreach (Generic.SandboxTag tag in fsRes4.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); RegistryQuery rQuery = new RegistryQuery(); Console.WriteLine("[+] Registry detection methods"); Generic.SandboxRes rQueryRes1 = rQuery.checkPath(); Console.WriteLine(" [-] Check if particular registry paths exist"); Console.WriteLine(" [*] Is sandbox? " + rQueryRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in rQueryRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes rQueryRes2 = rQuery.checkKeyValue(); Console.WriteLine(" [-] Check if particular registry keys contain specified strings"); Console.WriteLine(" [*] Is sandbox? " + rQueryRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in rQueryRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); OsChecks osCheck = new OsChecks(); Console.WriteLine("[+] Detection via generic OS checks"); Generic.SandboxRes osCheckRes1 = osCheck.checkUsername(); Console.WriteLine(" [-] Check if username is specific"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes2 = osCheck.checkComputerName(); Console.WriteLine(" [-] Check if computer name is specific"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes3 = osCheck.checkHostName(); Console.WriteLine(" [-] Check if host name is specific"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes3.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes3.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes4 = osCheck.checkComputerRAM(); Console.WriteLine(" [-] Check if total RAM is low"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes4.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes4.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes5 = osCheck.checkScreenRes(); Console.WriteLine(" [-] Check if screen resolution is non-usual for host OS"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes5.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes5.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes6 = osCheck.checkNProcessors(); Console.WriteLine(" [-] Check if number of processors is low"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes6.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes6.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes7 = osCheck.checkNScreens(); Console.WriteLine(" [-] Check if quantity of monitors is small"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes7.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes7.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes8 = osCheck.checkHDSize(); Console.WriteLine(" [-] Check if hard disk drive size and free space are small"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes8.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes8.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes osCheckRes9 = osCheck.checkSystemUptime(); Console.WriteLine(" [-] Check if system uptime is small"); Console.WriteLine(" [*] Is sandbox? " + osCheckRes9.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osCheckRes9.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } //Generic.SandboxRes osCheckRes10 = osCheck.checkBootVirtual(); //Console.WriteLine(" [-] Check if os was boot from virtual hard disk"); //Console.WriteLine(" [*] Is sandbox? " + osCheckRes10.isSandbox.ToString()); //foreach (Generic.SandboxTag tag in osCheckRes10.tagList) //{ // Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); //} Console.WriteLine(); GlobalObjects gObjects = new GlobalObjects(); Console.WriteLine("[+] Global objects detection methods"); Generic.SandboxRes gObjects1 = gObjects.checkGlobalMutexes(); Console.WriteLine(" [-] Check for specific global mutexes"); Console.WriteLine(" [*] Is sandbox? " + gObjects1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in gObjects1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); UiArtifacts uiArtifact = new UiArtifacts(); Console.WriteLine("[+] UI artifacts detection methods"); Generic.SandboxRes uiArtifactRes1 = uiArtifact.checkWindowTitle(); Console.WriteLine(" [-] Check if windows with certain class names are present in the OS"); Console.WriteLine(" [*] Is sandbox? " + uiArtifactRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in uiArtifactRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes uiArtifactRes2 = uiArtifact.checkNWindows(); Console.WriteLine(" [-] Check if windows with certain class names are present in the OS"); Console.WriteLine(" [*] Is sandbox? " + uiArtifactRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in uiArtifactRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); OsFeatures osFeature = new OsFeatures(); Console.WriteLine("[+] OS features detection methods"); Generic.SandboxRes osFeatureRes1 = osFeature.checkDebugPrivs(); Console.WriteLine(" [-] Checking debug privileges"); Console.WriteLine(" [*] Is sandbox? " + osFeatureRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in osFeatureRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); Processes processHelper = new Processes(); Console.WriteLine("[+] Processes and libraries detection methods"); Generic.SandboxRes processRes1 = processHelper.checkProcessName(); Console.WriteLine(" [-] Check specific running processes and loaded libraries"); Console.WriteLine(" [*] Is sandbox? " + processRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in processRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes processRes2 = processHelper.checkProcessDll(); Console.WriteLine(" [-] Check if specific libraries are loaded in the process address space"); Console.WriteLine(" [*] Is sandbox? " + processRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in processRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes processRes3 = processHelper.checkNProcess(); Console.WriteLine(" [-] Check number of processes"); Console.WriteLine(" [*] Is sandbox? " + processRes3.isSandbox.ToString()); foreach (Generic.SandboxTag tag in processRes3.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); NetworkHelpers networkHelper = new NetworkHelpers(); Console.WriteLine("[+] Network detection methods"); Generic.SandboxRes networkRes1 = networkHelper.checkMac(); Console.WriteLine(" [-] Check if MAC address is specific"); Console.WriteLine(" [*] Is sandbox? " + networkRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in networkRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes networkRes2 = networkHelper.checkAdapterName(); Console.WriteLine(" [-] Check if adapter name is specific"); Console.WriteLine(" [*] Is sandbox? " + networkRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in networkRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes networkRes3 = networkHelper.checkIP(); Console.WriteLine(" [-] Check if network belongs to security perimeter"); Console.WriteLine(" [*] Is sandbox? " + networkRes3.isSandbox.ToString()); foreach (Generic.SandboxTag tag in networkRes3.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes networkRes4 = networkHelper.checkCuckoo(); Console.WriteLine(" [-] Cuckoo ResultServer connection based anti-emulation technique"); Console.WriteLine(" [*] Is sandbox? " + networkRes4.isSandbox.ToString()); foreach (Generic.SandboxTag tag in networkRes4.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.WriteLine(); Hardware hwHelper = new Hardware(); Console.WriteLine("[+] Hardware info detection methods"); Generic.SandboxRes hwRes1 = hwHelper.checkHdName(); Console.WriteLine(" [-] Check if HDD has specific name"); Console.WriteLine(" [*] Is sandbox? " + hwRes1.isSandbox.ToString()); foreach (Generic.SandboxTag tag in hwRes1.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes hwRes2 = hwHelper.checkHdVendor(); Console.WriteLine(" [-] Check if HDD Vendor ID has specific value"); Console.WriteLine(" [*] Is sandbox? " + hwRes2.isSandbox.ToString()); foreach (Generic.SandboxTag tag in hwRes2.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Generic.SandboxRes hwRes3 = hwHelper.checkAudio(); Console.WriteLine(" [-] Check if CPU temperature information is available"); Console.WriteLine(" [*] Is sandbox? " + hwRes3.isSandbox.ToString()); foreach (Generic.SandboxTag tag in hwRes3.tagList) { Console.WriteLine(" Tag: {0} -> {1}", tag.tag, tag.query); } Console.ReadLine(); }
void Start() { Globals = GameObject.FindGameObjectWithTag("Globals").GetComponent <GlobalObjects>(); Player = GameObject.FindGameObjectWithTag("Player"); }
private async Task DownloadOfficeFiles() { try { SetTabStatus(false); GlobalObjects.ViewModel.BlockNavigation = true; _tokenSource = new CancellationTokenSource(); UpdateXml(); ProductUpdateSource.IsReadOnly = true; UpdatePath.IsEnabled = false; DownloadProgressBar.Maximum = 100; DownloadPercent.Content = ""; var configXml = GlobalObjects.ViewModel.ConfigXmlParser.ConfigurationXml; var startPath = ProductUpdateSource.Text.Trim(); if (!string.IsNullOrEmpty(startPath)) { GlobalObjects.ViewModel.DownloadFolderPath = startPath; } var channelItems = (List <Channel>)lvUsers.ItemsSource; var taskList = new List <Task>(); _lastUpdated = DateTime.Now.AddDays(-10); var startTime = DateTime.Now; foreach (var channelItem in channelItems) { if (!channelItem.Selected) { continue; } var branch = channelItem.ChannelName; var task = Task.Run(async() => { try { var proPlusDownloader = new ProPlusDownloader(); proPlusDownloader.DownloadFileProgress += (senderfp, progress) => { if (!_tokenSource.Token.IsCancellationRequested) { DownloadFileProgress(progress, channelItems, channelItem); } }; proPlusDownloader.VersionDetected += (sender, version) => { UpdateVersion(channelItems, channelItem, version.Version); }; if (string.IsNullOrEmpty(startPath)) { return; } var languages = (from product in configXml.Add.Products from language in product.Languages select language.ID.ToLower()).Distinct().ToList(); var officeEdition = GetSelectedEdition(); var buildPath = GlobalObjects.SetBranchFolderPath(branch, startPath); Directory.CreateDirectory(buildPath); var setVersion = channelItem.DisplayVersion; await proPlusDownloader.DownloadBranch(new DownloadBranchProperties() { BranchName = branch, OfficeEdition = officeEdition, TargetDirectory = buildPath, Languages = languages, Version = setVersion }, _tokenSource.Token); if (!_tokenSource.Token.IsCancellationRequested) { UpdatePercentage(channelItems, channelItem.Name); } LogAnaylytics("/ProductView", "Download." + branch); } catch (Exception ex) { if (!ex.Message.ToLower().Contains("aborted")) { ex.LogException(false); UpdateError(channelItems, channelItem.Name, "ERROR: " + ex.Message); } } }); if (!GlobalObjects.ViewModel.AllowMultipleDownloads) { await task; } if (_tokenSource.Token.IsCancellationRequested) { break; } var timeTaken = DateTime.Now - startTime; taskList.Add(task); await Task.Delay(new TimeSpan(0, 0, 5)); } await Task.Delay(new TimeSpan(0, 0, 1)); foreach (var task in taskList) { if (task.Exception != null) { } await task; } //MessageBox.Show("Download Complete"); } finally { SetTabStatus(true); GlobalObjects.ViewModel.BlockNavigation = false; ProductUpdateSource.IsReadOnly = false; UpdatePath.IsEnabled = true; DownloadProgressBar.Value = 0; DownloadPercent.Content = ""; DownloadButton.Content = "Download"; _tokenSource = new CancellationTokenSource(); } }
/// <summary> /// Displays info label, if any module is disabled /// </summary> private bool DisplayErrorText() { GlobalObjects = ";" + GlobalObjects + ";"; SiteObjects = ";" + SiteObjects + ";"; bool keyDisabled = false; bool isAnyKeySite = false; bool settingChecked = false; bool showSite = false; bool showGlobal = false; // Check config keys - stronger if (!String.IsNullOrEmpty(ConfigKeys)) { var keys = ConfigKeys.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string key in keys) { if (!ValidationHelper.GetBoolean(SettingsHelper.AppSettings[key], false)) { if (!AtLeastOne) { settingChecked = false; break; } } else { settingChecked = true; } } } // Check settings if (!settingChecked && !String.IsNullOrEmpty(SettingsKeys)) { int i = 0; var keys = SettingsKeys.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string key in keys) { String objectKey = ";" + key + ";"; bool globalObject = GlobalObjects.Contains(objectKey); bool siteObject = SiteObjects.Contains(objectKey); String siteKeyName = SiteName + "." + key; String keyName = (SiteOrGlobal || globalObject || KeyScope == DisabledModuleScope.Global) ? key : siteKeyName; // If module disabled if (!SettingsKeyInfoProvider.GetBoolValue(keyName) || (siteObject && !SettingsKeyInfoProvider.GetBoolValue(siteKeyName))) { // For site or global settings check site setting separately if (SiteOrGlobal && SettingsKeyInfoProvider.GetBoolValue(siteKeyName)) { settingChecked = true; i++; continue; } // If at least one is checked, info error is set later if (!AtLeastOne) { // If setting is global - hide site button var ski = SettingsKeyInfoProvider.GetSettingsKeyInfo(key); if ((ski != null) && (!ski.KeyIsGlobal)) { isAnyKeySite = true; } // Get text (either from collection of text or from single text property) String text = (InfoTexts.Count != 0 && InfoTexts.Count > i) ? InfoTexts[i] : InfoText; if (String.IsNullOrEmpty(text) && (ski != null)) { text = GenerateInfoText(ski); } if (lblText.Text != "") { lblText.Text += "<br />"; } // Add new text to label lblText.Text += text; // Add this key to collection of disabled keys // Make this info label visible keyDisabled = !String.IsNullOrEmpty(text); if (!siteObject && !globalObject) { showSite = (KeyScope != DisabledModuleScope.Global); showGlobal = (KeyScope != DisabledModuleScope.Site); } else { showSite |= siteObject; showGlobal |= globalObject; } } } else { settingChecked = true; } i++; } } // If atleastone is set, check if any setting is checked. If no, display warning message if (AtLeastOne && !settingChecked) { keyDisabled = true; lblText.Text = InfoText; } // If parent panel is set, show(hide) it if (ParentPanel != null) { ParentPanel.Visible = keyDisabled; } // Show/hide this control if module disabled Visible = keyDisabled; // Show site button only if any key is site btnSite.Visible = isAnyKeySite; // Set result to property SettingsEnabled = !keyDisabled; btnSite.Visible &= showSite; btnGlobal.Visible &= showGlobal; return(!keyDisabled); }