コード例 #1
0
        async Task Save()
        {
            if (String.IsNullOrWhiteSpace(Module.moduleID) &&
                String.IsNullOrWhiteSpace(Module.creditID) &&
                String.IsNullOrWhiteSpace(Module.staffID) &&
                String.IsNullOrWhiteSpace(Module.moduleName) &&
                String.IsNullOrWhiteSpace(Module.courseID))
            {
                await _pageService.DisplayAlert("Error", "Please enter All the Fields", "OK");

                return;
            }
            if (Module.id == 0)
            {
                await _moduleStore.AddModule(Module);

                ModuleAdded?.Invoke(this, Module);
            }
            else
            {
                await _moduleStore.UpdateModule(Module);

                ModuleUpdated?.Invoke(this, Module);
            }
            await _pageService.PopModalAsync();
        }
コード例 #2
0
        public IDebugModule3 GetOrCreate(SbModule lldbModule, IGgpDebugProgram program)
        {
            lock (cache)
            {
                if (!cache.TryGetValue(lldbModule, out IDebugModule3 module))
                {
                    module = moduleCreator(lldbModule, nextLoadOrder++, program);
                    cache.Add(lldbModule, module);

                    // TODO: Simplify inter-thread interactions in the VSI, and as part
                    // of that find a less ad-hoc solution to ModuleAdded/Removed event thread
                    // safety issues
                    mainThreadDispatcher.Post(() =>
                    {
                        try
                        {
                            ModuleAdded?.Invoke(Self, new ModuleAddedEventArgs(module));
                        }
                        catch (Exception e)
                        {
                            Trace.WriteLine(
                                $"Warning: ModuleAdded handler failed with exception: {e}");
                        }
                    });
                }
                ;
                return(module);
            }
        }
コード例 #3
0
        public int AddModule(Surrogate.Controller.IController module)
        {
            var key = module.GetHashCode();

            modules.Add(key, module);
            ModuleAdded?.Invoke(this, new ModuleArgs(module, key));
            return(key);
        }
コード例 #4
0
ファイル: MainController.cs プロジェクト: orf53975/eye
 protected virtual void OnModuleAdded(IControllerModule e)
 {
     ModuleAdded?.Invoke(this, e);
 }