コード例 #1
0
        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();
        }
コード例 #2
0
 protected override void Arrange()
 {
     base.Arrange();
     GlobalResources.SetDictionary(new KeyedResourceDictionary());
     extendedDictionary = GlobalResources.Get("ExtendedDictionary");
     extendedDictionary.MergedDictionaries.Clear();
 }
コード例 #3
0
ファイル: PPM.cs プロジェクト: DilipCNair/RBS
        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();
        }
コード例 #4
0
        static void Main(string[] args)
        {
            GlobalResources.Initialize();

            NSApplication.Init();
            NSApplication.Main(args);
        }
コード例 #5
0
 private void TextBox_MasterPassword_KeyDown(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Enter)
     {
         GlobalResources.IInitiatedKeyDownFromTextBox();
     }
 }
コード例 #6
0
 protected override void Arrange()
 {
     base.Arrange();
     GlobalResources.Clear();
     addedResource = new ResourceDictionary();
     GlobalResources.Add("testDictionaryOne", addedResource, false);
 }
コード例 #7
0
        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;
                }
            });
        }
コード例 #8
0
 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)
     { }
 }
コード例 #9
0
ファイル: WindowsServices.cs プロジェクト: DilipCNair/RBS
        private static void Worker_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            BGWData BGWData = e.Result as BGWData;

            Worker.Dispose();
            GlobalResources.WinServIsOver();
        }
コード例 #10
0
ファイル: HomeViewModel.cs プロジェクト: DilipCNair/RBS
        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();
        }
コード例 #11
0
        protected override void Act()
        {
            Uri extensionsUri = UriTestHelper.GetTestResourceUri("SomeResourceFile.xaml");

            GlobalResources.AddExtendedDictionary((ResourceDictionary)Application.LoadComponent(extensionsUri));
            GlobalResources.AddExtendedDictionary((ResourceDictionary)Application.LoadComponent(extensionsUri));
        }
コード例 #12
0
        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");
        }
コード例 #13
0
 protected override void Arrange()
 {
     keyedDictionary = new KeyedResourceDictionary();
     GlobalResources.SetDictionary(keyedDictionary);
     GlobalResources.Add("testDictionary1",
                         "/Microsoft.Practices.EnterpriseLibrary.Configuration.DesignTime;component/Themes/Generic.xaml",
                         true);
 }
コード例 #14
0
 public static GlobalResources Instance()
 {
     if ((Object)_Instance == (Object)null)
     {
         _Instance = Resources.Load <GlobalResources>("GlobalResources");
     }
     return(_Instance);
 }
コード例 #15
0
 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();
 }
コード例 #16
0
 /// <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();
 }
コード例 #17
0
 protected override void Arrange()
 {
     base.Arrange();
     GlobalResources.Clear();
     foreach (var entry in AddedDictionaries)
     {
         GlobalResources.Add(entry.Key, entry.Value, false);
     }
 }
コード例 #18
0
ファイル: PageViewModel.cs プロジェクト: uzbekdev1/Cobalt
 protected override void OnDeactivate(bool close)
 {
     OnDeactivate(close, Resources);
     Resources.Dispose();
     if (close)
     {
         GlobalResources.Dispose();
     }
 }
コード例 #19
0
        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);
     }
 }
コード例 #21
0
ファイル: Gui.cs プロジェクト: urthegame/main
    //    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();
    }
コード例 #22
0
        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);
        }
コード例 #23
0
ファイル: ResourceStrings.cs プロジェクト: JackyW83/Test
        /// <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;
        }
コード例 #24
0
        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);
        }
コード例 #25
0
 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();
 }
コード例 #26
0
    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);
        }
    }
コード例 #27
0
ファイル: ResourceStrings.cs プロジェクト: KamilZet/BugNet
        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);
        }
コード例 #28
0
ファイル: Process Monitoring.cs プロジェクト: DilipCNair/RBS
        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);
                }
            }
        }
コード例 #29
0
        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);
        }
コード例 #30
0
 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);
     }
 }
コード例 #31
0
        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();
            }
        }
コード例 #33
0
ファイル: run-animation.cs プロジェクト: carriercomm/scsharp
	public RunAnimation (Mpq mpq)
	{
		this.mpq = mpq;

		GlobalResources globals = new GlobalResources (mpq);
		//		globals.Ready += GlobalsReady;

		globals.Load ();
		
		CreateWindow ();

		Timer.DelaySeconds (5);

		GlobalsReady ();
	}
コード例 #34
0
ファイル: BaseLevelThing.cs プロジェクト: urthegame/main
    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;
    }
コード例 #35
0
ファイル: Level.cs プロジェクト: urthegame/main
    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>();
    }
コード例 #36
0
 /// <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);
 }