コード例 #1
0
 public override void ShowSplash(ISplashView view)
 {
     var splashPage = (SplashPage) view;
     splashPage.SetImageLocation(SplashImageLocation);
     Window.Current.Content = splashPage;
     Window.Current.Activate();
 }
コード例 #2
0
ファイル: SplashPresenter.cs プロジェクト: kouweizhong/vrs
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="view"></param>
        public void Initialise(ISplashView view)
        {
            _View = view;

            _View.ApplicationName    = Strings.VirtualRadarServer;
            _View.ApplicationVersion = Factory.Singleton.Resolve <IApplicationInformation>().ShortVersion;
        }
コード例 #3
0
ファイル: SplashPresenter.cs プロジェクト: ts295983632/vrs
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="view"></param>
        public void Initialise(ISplashView view)
        {
            _View = view;

            var applicationInfo = Factory.Resolve <IApplicationInformation>();

            _View.ApplicationName    = Strings.VirtualRadarServer;
            _View.IsBeta             = applicationInfo.IsBeta;
            _View.ApplicationVersion = applicationInfo.ShortVersion;
        }
コード例 #4
0
ファイル: PluginManager.cs プロジェクト: secondii/Yutai
        /// <summary>
        /// Validates the list of plugins loaded by MEF.
        /// </summary>
        public void ValidatePlugins(ISplashView splashView)
        {
            _plugins.Clear();

            var dict = new Dictionary <Guid, BasePlugin>();

            if (_mefPlugins == null)
            {
                return;
            }

            foreach (var item in _mefPlugins)
            {
                var p = item.Value as BasePlugin;
                if (p == null)
                {
                    Logger.Current.Warn("Invalid plugin type: plugin must inherit from BasePlugin type.");
                    continue;
                }

                try
                {
                    p.Identity = PluginIdentityHelper.GetIdentity(p.GetType(), item.Metadata);
                }
                catch (Exception ex)
                {
                    throw new ApplicationException("Failed to load plugin identity from assembly.", ex);
                }

                // TODO: make sure that application plugins will have priority if duplicate GUIDs are found
                if (dict.ContainsKey(p.Identity.Guid))
                {
                    var    p2  = dict[p.Identity.Guid];
                    string msg = string.Format("Plugins have duplicate GUIDs: {0} {1}", p, p2);
                    throw new ApplicationException(msg);
                }
                splashView.ShowStatus("正在检查:" + p.Description);
                dict.Add(p.Identity.Guid, p);

                _container.RegisterInstance(p.GetType(), p);

                _plugins.Add(p);
            }

#if DEBUG
            // I didn't caught anything by this check so far;
            // Perhaps better just to check for particular assemblies in Plugins folder
            // and display warning if they are present
            CheckDuplicatedAssemblies();
#endif
        }
コード例 #5
0
        private void ShowSplash()
        {
            // Create the window
            var server = ServerRepository.Instance.Source;

            server.Connect();
            CustomContainer.Register(server);
            var toolBoxViewModel = new ToolboxViewModel(new ToolboxModel(server, server, null), new ToolboxModel(server, server, null));

            CustomContainer.Register <IToolboxViewModel>(toolBoxViewModel);

            var textToDisplay = Warewolf.Studio.Resources.Languages.Core.StandardStyling.Replace("\r\n", "") +
                                Warewolf.Studio.Resources.Languages.HelpText.WarewolfDefaultHelpDescription +
                                Warewolf.Studio.Resources.Languages.Core.StandardBodyParagraphClosing;

            var helpViewModel = new HelpWindowViewModel(new HelpDescriptorViewModel(new HelpDescriptor("", textToDisplay, null)), new HelpModel(new EventAggregator()));

            CustomContainer.Register <IHelpWindowViewModel>(helpViewModel);
            CustomContainer.Register <IEventAggregator>(new EventAggregator());
            CustomContainer.Register <IPopupController>(new PopupController());
            CustomContainer.Register <IAsyncWorker>(new AsyncWorker());
            CustomContainer.Register <IWarewolfWebClient>(new WarewolfWebClient(new WebClient {
                Credentials = CredentialCache.DefaultCredentials
            }));
            CustomContainer.RegisterInstancePerRequestType <IRequestServiceNameView>(() => new RequestServiceNameView());
            CustomContainer.RegisterInstancePerRequestType <IJsonObjectsView>(() => new JsonObjectsView());
            CustomContainer.RegisterInstancePerRequestType <IChooseDLLView>(() => new ChooseDLLView());
            CustomContainer.RegisterInstancePerRequestType <IFileChooserView>(() => new FileChooserView());
            //CustomContainer.RegisterInstancePerRequestType<ICreateDuplicateResourceView>(() => new CreateDuplicateResourceDialog());



            var splashViewModel = new SplashViewModel(server, new ExternalProcessExecutor());

            var splashPage = new SplashPage {
                DataContext = splashViewModel
            };

            SplashView = splashPage;
            // Show it
            SplashView.Show(false);

            // Now that the window is created, allow the rest of the startup to run
            _resetSplashCreated?.Set();
            splashViewModel.ShowServerVersion();
            Dispatcher.Run();
        }
コード例 #6
0
ファイル: PluginManager.cs プロジェクト: secondii/Yutai
        /// <summary>
        /// Searches plugins in plugins folder with MEF.
        /// </summary>
        public void AssemblePlugins(ISplashView splashView)
        {
            try
            {
                var aggregateCatalog = new AggregateCatalog();

                aggregateCatalog.Catalogs.Add(GetPluginCatalog());

                var container = new CompositionContainer(aggregateCatalog);

                container.ComposeParts(this);

                ValidatePlugins(splashView);
            }
            catch (Exception ex)
            {
                Logger.Current.Error("Failed to initialize plugin manager", ex);
            }
        }
コード例 #7
0
        /// <summary>
        /// See interface docs.
        /// </summary>
        /// <param name="view"></param>
        public void Initialise(ISplashView view)
        {
            _View = view;

            _View.ApplicationName = Strings.VirtualRadarServer;
            _View.ApplicationVersion = Factory.Singleton.Resolve<IApplicationInformation>().ShortVersion;

            Factory.Singleton.Resolve<IStatistics>().Singleton.Initialise();
        }
コード例 #8
0
 public virtual void BindSplashView(ISplashView view)
 {
     _splashView = view;
     _splashView.OnViewDestroy = (view2) =>
     {
         _splashPresenter.ViewDestroyed();
         _splashPresenter = null;
         _splashView = null;
     };
     _splashPresenter = Bootstrapper.GetContainer().Resolve<ISplashPresenter>();
     _splashPresenter.BindView(view);
     _splashPresenter.Initialize(ContinueAfterSplash);
 }
コード例 #9
0
 public virtual void CreateSplashView()
 {
     if (_splashView == null)
         _splashView = Bootstrapper.GetContainer().Resolve<ISplashView>();
 }
コード例 #10
0
 public SplashPresenter(ISplashView splashView)
 {
     this.splashView = splashView;
 }
コード例 #11
0
ファイル: Splasher.cs プロジェクト: BgRva/Blob1
        private static void CreateInstance(Type FormType)
        {
            object obj = FormType.InvokeMember(null,
                                BindingFlags.DeclaredOnly |
                                BindingFlags.Public | BindingFlags.NonPublic |
                                BindingFlags.Instance | BindingFlags.CreateInstance, null, null, null);
            _SplashForm = obj as Form;
            _SplashView = obj as ISplashView;
            if (_SplashForm == null)
            {
                throw (new Exception("Splash Screen must inherit from System.Windows.Forms.Form"));
            }
            if (_SplashView == null)
            {
                throw (new Exception("must implement interface ISplashForm"));
            }

            if (!string.IsNullOrEmpty(_Mssg))
                _SplashView.AppendStatusInfo(_Mssg);
        }
コード例 #12
0
 public SplashPresenter(ISplashView view) : base(view)
 {
     _view = view;
 }
コード例 #13
0
 public override void ShowSplash(ISplashView view)
 {
     Debug.WriteLine("WindowsPhoneNavigationManager - ShowSplash");
 }
コード例 #14
0
ファイル: NavigationManager.cs プロジェクト: pascalfr/MPfm
        public virtual ISplashView CreateSplashView()
        {
            // The view invokes the OnViewReady action when the view is ready. This means the presenter can be created and bound to the view.
            Action onInitDone = () =>
            {
                Tracing.Log("SplashInitDone");
                try
                {
                    var resumePlaybackService = Bootstrapper.GetContainer().Resolve<IResumePlaybackService>();
                    _resumeCloudDeviceInfo = resumePlaybackService.GetResumePlaybackInfo();
                    CreateMainView();

                    if(_resumeCloudDeviceInfo != null)
                        CreateStartResumePlaybackView();
                }
                catch(Exception ex)
                {
                    Tracing.Log("NavigationManager - CreateMainView - Exception: {0}", ex);
                    throw;
                }
            };
            Action<IBaseView> onViewReady = (view) =>
            {
                _splashPresenter = Bootstrapper.GetContainer().Resolve<ISplashPresenter>();
                _splashPresenter.BindView((ISplashView)view);
                _splashPresenter.Initialize(onInitDone); // TODO: Should the presenter call NavMgr instead of using an action?
            };
            _splashView = Bootstrapper.GetContainer().Resolve<ISplashView>(new NamedParameterOverloads() { { "onViewReady", onViewReady } });
            _splashView.OnViewDestroy = (view) =>
            {
                _splashPresenter.ViewDestroyed();
                _splashPresenter = null;
                _splashView = null;
            };
            return _splashView;
        }
コード例 #15
0
 public SplashPresenter(Context context, ISplashView splashView)
 {
     this.context    = context;
     this.splashView = splashView;
 }