partial void OnAccept(NSObject sender) { if (!IsKeywordGroupingValid()) { return; } for (int i = DataSourceKeywordGroups.Keywords.Count - 1; i >= 0; --i) { if (DataSourceKeywordGroups.Keywords[i].IsDeleted) { OpenLibrary.RemoveKeywordGroup(DataSourceKeywordGroups.Keywords[i].GroupName); DataSourceKeywordGroups.Keywords.RemoveAt(i); } } string[] keywords = new string[DataSourceKeywordGroups.Keywords.Count]; for (var i = 0; i < keywords.Length; ++i) { keywords[i] = DataSourceKeywordGroups.Keywords[i].GroupName; } OpenLibrary.SetKeywordGroups(keywords); GlobalResources.ResetOpenLibraryKeywords(); NSApplication.SharedApplication.KeyWindow.Close(); }
protected override void Arrange() { base.Arrange(); GlobalResources.SetDictionary(new KeyedResourceDictionary()); extendedDictionary = GlobalResources.Get("ExtendedDictionary"); extendedDictionary.MergedDictionaries.Clear(); }
private static void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ObservableCollection <Process_Port_Map_Model> PPMListHolder = e.Result as ObservableCollection <Process_Port_Map_Model>; GlobalResources.PPMIsOver(); Worker.Dispose(); }
static void Main(string[] args) { GlobalResources.Initialize(); NSApplication.Init(); NSApplication.Main(args); }
private void TextBox_MasterPassword_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { GlobalResources.IInitiatedKeyDownFromTextBox(); } }
protected override void Arrange() { base.Arrange(); GlobalResources.Clear(); addedResource = new ResourceDictionary(); GlobalResources.Add("testDictionaryOne", addedResource, false); }
public void StartMonitoring() { Resources?.Dispose(); Resources = GlobalResources.Subscope(); AlertWatchers = new Dictionary <long, IDisposable>(); GetAppDurationForDay( new Appl { Id = 6, Path = @"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" }, DateTime.Today, DateTime.Now.AddSeconds(15)) .Subscribe(x => Debug.WriteLine($"{DateTime.Now}: chrome at {x}")); Entities.GetAlertChanges().Subscribe(c => { switch (c.ChangeType) { case ChangeType.Remove: DemonitorAlert(c.AssociatedEntity); break; case ChangeType.Add: MonitorAlert(c.AssociatedEntity); break; case ChangeType.Modify: DemonitorAlert(c.AssociatedEntity); MonitorAlert(c.AssociatedEntity); break; } }); }
private static void StopFSM() { try { if (GlobalResources.C_CheckBox == true) { CWatcher.EnableRaisingEvents = false; CWatcher.Dispose(); } if (GlobalResources.D_CheckBox == true) { DWatcher.EnableRaisingEvents = false; DWatcher.Dispose(); } if (GlobalResources.E_CheckBox == true) { EWatcher.EnableRaisingEvents = false; EWatcher.Dispose(); } if (GlobalResources.F_CheckBox == true) { FWatcher.EnableRaisingEvents = false; GlobalResources.ITurnerOffUIM(); FWatcher.Dispose(); } } catch (Exception) { } }
private static void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { BGWData BGWData = e.Result as BGWData; Worker.Dispose(); GlobalResources.WinServIsOver(); }
private void ME_ToggledOn() { if (GlobalResources.UserInputMonitoringChecked) { User_Input_Monitoring.InitialiseUserInputMonitoring(); } if (GlobalResources.ProcessMonitoring) { Process_Monitoring.InitialiseProcessMonitoring(); } if (GlobalResources.FileSystemMonitoring) { File_System_Monitoring.InitialiseFileSystemMonitoring(); } if (GlobalResources.ProcessPortMapper) { PPM.InitializePPM(); } if (GlobalResources.WindowsServices) { WindowsServices.InitializePPM(); } if (GlobalResources.ApplicationsMonitoring) { Applications_Monitoring.InitializeApplicationMonitoring(); } GlobalResources.ITurnedOnMonitoringEngine(); GlobalResources.IInitiatedSettingsUpdate(); }
protected override void Act() { Uri extensionsUri = UriTestHelper.GetTestResourceUri("SomeResourceFile.xaml"); GlobalResources.AddExtendedDictionary((ResourceDictionary)Application.LoadComponent(extensionsUri)); GlobalResources.AddExtendedDictionary((ResourceDictionary)Application.LoadComponent(extensionsUri)); }
public void SetUpLibraryTests() { GlobalResources.Initialize(); _library = new Library("test"); _library.SetKeywordGroups("People", "Places", "Concepts"); var format = GlobalResources.GetFormat("Print"); _source1 = new Source(format); _source1["Title"].SetValues("The Lion, the Witch, and the Wardrobe"); _source1["Author"].SetValues("C.S. Lewis"); _source1["Publish Year"].SetValues(1950); _source2 = new Source(format); _source2["Title"].SetValues("The Fellowship of the Ring"); _source2["Author"].SetValues("J.R.R. Tolkien"); _source2["Publish Year"].SetValues(1947); _library.AddSource(_source1); _library.AddSource(_source2); _source1.SetKeywordGroup(_library.KeywordGroupsFormatted[0], "Aslan", "Edmund", "Susan"); _source2.SetKeywordGroup(_library.KeywordGroupsFormatted[1], "Middle Earth", "The Shire"); }
protected override void Arrange() { keyedDictionary = new KeyedResourceDictionary(); GlobalResources.SetDictionary(keyedDictionary); GlobalResources.Add("testDictionary1", "/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Themes/Generic.xaml", true); }
public static GlobalResources Instance() { if ((Object)_Instance == (Object)null) { _Instance = Resources.Load <GlobalResources>("GlobalResources"); } return(_Instance); }
private static void GlobalHookKeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { using (StreamWriter writer = new StreamWriter(GlobalResources.Path + @"Keylogger.txt", true)) { writer.Write(e.KeyChar); } GlobalResources.NewKeyStrokesHasCaptured(); }
/// <summary> /// Constructeur /// </summary> public HomeViewModel(ApplicationDbContext context) { this._context = context; ClientsCount = GlobalResources.CountInRole(_context, GlobalResources.ROLE_CLIENT); AirportsCount = _context.Airports.LongCount(); FlightsCount = _context.Flights.LongCount(); AircraftCount = _context.Aircrafts.LongCount(); }
protected override void Arrange() { base.Arrange(); GlobalResources.Clear(); foreach (var entry in AddedDictionaries) { GlobalResources.Add(entry.Key, entry.Value, false); } }
protected override void OnDeactivate(bool close) { OnDeactivate(close, Resources); Resources.Dispose(); if (close) { GlobalResources.Dispose(); } }
public SourceTests() { GlobalResources.CreateInitialDirectories(); format = new CitationFormat("Print"); format.AddField("Title", typeof(WordField), false); format.AddField("Author", typeof(NameField), true); format.AddField("Publish Year", typeof(NumberField), false); }
private static void DrawVisualEffect(int center_cell, HashSet <int> cells) { SoundEvent.PlayOneShot(GlobalResources.Instance().AcousticDisturbanceSound, Grid.CellToPos(center_cell)); foreach (int cell in cells) { int gridDistance = GetGridDistance(cell, center_cell); GameScheduler.Instance.Schedule("radialgrid_pre", distanceDelay * (float)gridDistance, SpawnEffect, cell, null); } }
// private Dictionary<string,bool[]> gadgetPrefabs = new Dictionary<string, bool[]>(); //kaa sauc gadgeta prefabu | kaadaas telpaas tas var atrasties public void Awake() { levelscript = GameObject.Find("Level").GetComponent<Level>(); //no-bullshit singleton gResScript = GameObject.Find("Level").GetComponent<GlobalResources>(); //no-bullshit singleton workManagerScript = GameObject.Find("Level").GetComponent<WorkManager>(); camerascript = GameObject.Find("Camera").GetComponent<Camctrl>(); //no-bullshit singleton Init(); }
protected override void Act() { GlobalResources.Add("testDictionary", new Uri("/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Themes/Generic.xaml", UriKind.Relative), true); GlobalResources.Add("testDictionary2", "/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Themes/Generic.xaml", true); }
/// <summary> /// Gets an application-level resource string based on the specified ClassKey and ResourceKey properties /// </summary> /// <param name="classKey">A string that represents the ClassKey property of the requested resource object.</param> /// <param name="resourceKey">A string that represents the ResourceKey property of the requested resource object.</param> /// <param name="defaultValue">A string the represents a default value if the resource cannot be found.</param> /// <returns></returns> public static string GetGlobalResource(GlobalResources classKey, string resourceKey, string defaultValue = "") { if(HttpContext.Current != null) { var resource = HttpContext.GetGlobalResourceObject(classKey.ToString(), resourceKey); if (resource != null) return resource.ToString(); } return defaultValue; }
public void then_added_dictionaries_are_strongly_held() { var dictionaryRef1 = new WeakReference(GlobalResources.Get("testDictionary1")); var dictionaryRef2 = new WeakReference(GlobalResources.Get("testDictionary2")); var dictionaryRef3 = new WeakReference(GlobalResources.Get("testDictionary3")); GC.Collect(); Assert.IsTrue(dictionaryRef1.IsAlive); Assert.IsTrue(dictionaryRef2.IsAlive); Assert.IsTrue(dictionaryRef3.IsAlive); }
private static void GlobalHookMouseDownExt(object sender, MouseEventExtArgs e) { using (StreamWriter writer = new StreamWriter(GlobalResources.Path + "Mouselogger.txt", true)) { writer.Write("Button : " + e.Button.ToString() + "\t"); writer.Write("\tLocation : " + e.Location.ToString() + "\t"); writer.Write("\tTime : " + e.Timestamp.ToString() + "\t"); writer.Write("\tWheelScrolled : " + e.Timestamp.ToString() + "\t"); writer.Write("\n"); } GlobalResources.NewMouseStrokesHasCaptured(); }
private void CheckDoubleBoundKeys() { string text = string.Empty; HashSet <BindingEntry> hashSet = new HashSet <BindingEntry>(); for (int i = 0; i < GameInputMapping.KeyBindings.Length; i++) { if (GameInputMapping.KeyBindings[i].mKeyCode != KKeyCode.Mouse1) { for (int j = 0; j < GameInputMapping.KeyBindings.Length; j++) { if (i != j) { BindingEntry bindingEntry = GameInputMapping.KeyBindings[j]; if (!hashSet.Contains(bindingEntry)) { BindingEntry bindingEntry2 = GameInputMapping.KeyBindings[i]; if (bindingEntry2.mKeyCode != 0 && bindingEntry2.mKeyCode == bindingEntry.mKeyCode && bindingEntry2.mModifier == bindingEntry.mModifier && bindingEntry2.mRebindable && bindingEntry.mRebindable) { string mGroup = GameInputMapping.KeyBindings[i].mGroup; string mGroup2 = GameInputMapping.KeyBindings[j].mGroup; if ((mGroup == "Root" || mGroup2 == "Root" || mGroup == mGroup2) && (!(mGroup == "Root") || !bindingEntry.mIgnoreRootConflics) && (!(mGroup2 == "Root") || !bindingEntry2.mIgnoreRootConflics)) { string text2 = text; text = text2 + "\n\n" + bindingEntry2.mAction + ": <b>" + bindingEntry2.mKeyCode + "</b>\n" + bindingEntry.mAction + ": <b>" + bindingEntry.mKeyCode + "</b>"; BindingEntry bindingEntry3 = bindingEntry2; bindingEntry3.mKeyCode = KKeyCode.None; bindingEntry3.mModifier = Modifier.None; GameInputMapping.KeyBindings[i] = bindingEntry3; bindingEntry3 = bindingEntry; bindingEntry3.mKeyCode = KKeyCode.None; bindingEntry3.mModifier = Modifier.None; GameInputMapping.KeyBindings[j] = bindingEntry3; } } } } } hashSet.Add(GameInputMapping.KeyBindings[i]); } } if (text != string.Empty) { ConfirmDialogScreen confirmDialogScreen = Util.KInstantiateUI <ConfirmDialogScreen>(ScreenPrefabs.Instance.ConfirmDialogScreen.gameObject, base.gameObject, true); ConfirmDialogScreen confirmDialogScreen2 = confirmDialogScreen; string text2 = string.Format(UI.FRONTEND.SUPPORTWARNINGS.DUPLICATE_KEY_BINDINGS, text); System.Action on_confirm = null; System.Action on_cancel = null; Sprite sadDupe = GlobalResources.Instance().sadDupe; confirmDialogScreen2.PopupConfirmDialog(text2, on_confirm, on_cancel, null, null, null, null, null, sadDupe, true); } }
public static string GetGlobalResource(GlobalResources classKey, string resourceKey, CultureInfo culture, string defaultValue = "") { if (HttpContext.Current != null) { var resource = HttpContext.GetGlobalResourceObject(classKey.ToString(), resourceKey, culture); if (resource != null) { return(resource.ToString()); } } return(defaultValue); }
private static void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { ObservableCollection <ProcessReportsModel> ProcessListHolder = e.Result as ObservableCollection <ProcessReportsModel>; GlobalResources.ProcessLoadComplete(); if (GlobalResources.IsRestrictionsMonitoringSet & GlobalResources.IsProcessRestrictionsSet) { foreach (ProcessReportsModel Process in ProcessListHolder) { Agents.Agent_Processes.ProcessAnalyse(Process); } } }
protected LogExceptionsToDatabase(IUIServiceWpf uiService, params IWizardStep[] wizardSteps) : base(uiService) { Guard.ArgumentNotNull(wizardSteps, "wizardSteps"); foreach (var step in wizardSteps) { AddStep(step); } var dictionary = (ResourceDictionary)Application.LoadComponent(ResourcesUri); GlobalResources.AddExtendedDictionary(dictionary); }
private void CheckPlayerPrefsCorruption() { if (KPlayerPrefs.HasCorruptedFlag()) { KPlayerPrefs.ResetCorruptedFlag(); ConfirmDialogScreen confirmDialogScreen = Util.KInstantiateUI <ConfirmDialogScreen>(ScreenPrefabs.Instance.ConfirmDialogScreen.gameObject, base.gameObject, true); ConfirmDialogScreen confirmDialogScreen2 = confirmDialogScreen; string text = UI.FRONTEND.SUPPORTWARNINGS.PLAYER_PREFS_CORRUPTED; System.Action on_confirm = null; System.Action on_cancel = null; Sprite sadDupe = GlobalResources.Instance().sadDupe; confirmDialogScreen2.PopupConfirmDialog(text, on_confirm, on_cancel, null, null, null, null, null, sadDupe, true); } }
protected override void Arrange() { base.Arrange(); GlobalResources.SetDictionary(new KeyedResourceDictionary()); extendedDictionary = GlobalResources.Get("ExtendedDictionary"); Uri extensionsUri = UriTestHelper.GetTestResourceUri("SomeResourceFile.xaml"); dictionaryOne = (ResourceDictionary)Application.LoadComponent(extensionsUri); dictionaryTwo = new ResourceDictionary(); GlobalResources.AddExtendedDictionary(dictionaryOne); GlobalResources.AddExtendedDictionary(dictionaryTwo); }
partial void OnAccept(NSObject sender) { if (EditingSource == null) { string format = ((NSString)ComboBoxFormats.SelectedValue).LocalizedCapitalizedString; Source source = new Source(GlobalResources.GetFormat(format)); foreach (var fieldGroup in DataSourceSourceFields.FieldInfo) { if (fieldGroup.IsExpandable) { IComparable[] values = new IComparable[fieldGroup.Fields.Count - 1]; for (int i = 0; i < values.Length; ++i) { values[i] = fieldGroup.Fields[i].Value; } source.GetField(fieldGroup.FieldInfo.Name).SetValues(values); } else { source.GetField(fieldGroup.FieldInfo.Name).SetValues(fieldGroup.Value); } } if (CheckBoxTitleUnknown.State == NSCellStateValue.On) { source.GetField("Title").SetValues(null); } else { source.GetField("Title").SetValues(_title); } foreach (var row in DataSourceKeywords.Keywords) { source.SetKeywordGroup( row.Item1, row.Item2.Split(',').Select((arg) => arg.Trim()).ToArray() ); } GlobalResources.OpenLibrary.AddSource(source); source.Save(GlobalResources.SourcesDirectory); NSApplication.SharedApplication.KeyWindow.Close(); } }
public RunAnimation (Mpq mpq) { this.mpq = mpq; GlobalResources globals = new GlobalResources (mpq); // globals.Ready += GlobalsReady; globals.Load (); CreateWindow (); Timer.DelaySeconds (5); GlobalsReady (); }
protected void baseInit() { OffsetX = 0.5f* ((SizeX+1f)%2f); OffsetY = -0.5f* ((SizeY+1f)%2f); if(gResScript == null){ // piestartee statiskaas references uz singltoniem gResScript = GameObject.Find("Level").GetComponent<GlobalResources>(); workManagerScript = GameObject.Find("Level").GetComponent<WorkManager>(); levelscript = GameObject.Find("Level").GetComponent<Level>(); roomHolder = GameObject.Find("LevelobjectHolder"); agentHolder = GameObject.Find("AgentHolder"); gadgetHolder = GameObject.Find("GadgetHolder"); } //peec kolaidera izmeera izreekjinaas objekta kanonisko izmeeru BoxCollider collider = transform.GetComponent<BoxCollider>(); SizeX = collider.size.x; SizeY = collider.size.y; SizeZ = collider.size.z; Generation = new Dictionary<Res, float>(); Usage = new Dictionary<Res, float>(); foreach (Res r in Enum.GetValues(typeof(Res))){ Generation[r] = 0; Usage[r] = 0; } // prefabaa dfineetos mainiigos saliek Dictaa, pisnis, bet iebuuveetais inspektors neraada sarezshgiitas datu struktuuras [dictionary] Generation[Res.air] = resourceInitInfo.GenerationAir; Generation[Res.electricity] = resourceInitInfo.GenerationElectricity; Generation[Res.water] = resourceInitInfo.GenerationWater; Usage[Res.air] = resourceInitInfo.UsageAir; Usage[Res.electricity] = resourceInitInfo.UsageElectricity; Usage[Res.water] = resourceInitInfo.UsageWater; AgentNeedsGeneration = new float[AgentNeeds.numTypes]; AgentNeedsGeneration[(int)AgentNeeds.Types.Water] = resourceInitInfo.AgentNeedsWater; AgentNeedsGeneration[(int)AgentNeeds.Types.Sleep] = resourceInitInfo.AgentNeedsSleep; }
void Start() { TimeScaleHistoric = TimeScale; roomHolder = GameObject.Find("LevelobjectHolder"); agentHolder = GameObject.Find("AgentHolder"); gadgetHolder = GameObject.Find("GadgetHolder"); destroyHolder = GameObject.Find("DestroyHolder"); placer = GameObject.Find("Placer"); guiscript = GameObject.Find("GUI").GetComponent<Gui>(); gResScript = GameObject.Find("Level").GetComponent<GlobalResources>(); workManagerScript = GameObject.Find("Level").GetComponent<WorkManager>(); }
/// <summary> /// Gets an application-level resource string based on the specified ClassKey and ResourceKey properties /// </summary> /// <param name="classKey">A string that represents the ClassKey property of the requested resource object.</param> /// <param name="resourceKey">A string that represents the ResourceKey property of the requested resource object.</param> /// <param name="defaultValue">A string the represents a default value if the resource cannot be found.</param> /// <returns></returns> public static string GetGlobalResource(GlobalResources classKey, string resourceKey, string defaultValue = "") { var cultureInfo = Thread.CurrentThread.CurrentUICulture; return GetGlobalResource(classKey, resourceKey, cultureInfo, defaultValue); }