Ejemplo n.º 1
0
        /// <summary>The on startup.</summary>
        /// <param name="e">The e.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.InitializeErrorHandler();
            NotificationView.Initialize();
            var result = new QueueHandler(e.Args).Process();

            string message = null;

            if (result == Status.Success)
            {
                message = Literals.ShellExtension_Subtitles_downloaded_successfully;
            }
            else if (result == Status.Fatal)
            {
                message = Literals.ShellExtension_Failed_process_request;
            }

            if (string.IsNullOrEmpty(message))
            {
                NotificationView.AttachEndHandler((sender, args) => this.Dispatcher.InvokeShutdown());
            }
            else
            {
                NotificationView.Show(message, (sender, args) => this.Dispatcher.InvokeShutdown());
            }
        }
Ejemplo n.º 2
0
        /// <summary>The on startup.</summary>
        /// <param name="e">The e.</param>
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            this.InitializeErrorHandler();
            NotificationView.Initialize();
            var mainView = new WpfView();

            this.MainWindow = mainView.Window;
            this.controller = new MainViewController(mainView, new AggregateCalendar());
            this.controller.Query();
        }
    private void saveToPrefab()
    {
        var assemblies = System.AppDomain.CurrentDomain.GetAssemblies();

        System.Type viewType = null;
        System.Type dataType = null;
        foreach (var assembly in assemblies)
        {
            viewType = assembly.GetType(m_viewTypeName);
            if (viewType != null)
            {
                dataType = assembly.GetType(m_dataTypeName);
                break;
            }
        }
        //Debug.Log(viewType);

        NotificationView notificationView = NotificationViewObject.AddComponent(viewType) as NotificationView;

        notificationView.Initialize(m_selectedApp, m_templateID2Create, "Editor");
        notificationView.NotificationDataReflection = dataType.AssemblyQualifiedName;
        //MonoScript[] scripts = (MonoScript[])Resources.FindObjectsOfTypeAll(typeof(MonoScript));

        //foreach (MonoScript script in scripts)
        //{
        //    if (script.GetClass() != null && script.GetClass() == dataType)
        //    {
        //        notificationView.NotificationData = script;
        //        break;
        //    }
        //}
        PrefabUtility.SaveAsPrefabAssetAndConnect(NotificationViewObject, "Assets" + NotificationController.PrefabPath + "/" + m_templateID2Create + "_" + (int)m_selectedApp + "_" + "NotificationView.prefab", InteractionMode.AutomatedAction);
        m_selectedTemplate = m_templateOption.Length - 1;
        IsCreating         = false;
        UpdateInfo();
    }