Пример #1
0
        public EplanEventListener()
        {
            onUserPreCloseProject
            .SetEvent("Eplan.EplApi.OnUserPreCloseProject");
            onUserPreCloseProject.EplanEvent +=
                new EventHandlerFunction(OnUserPreCloseProject);

            onPostOpenProject.SetEvent("Eplan.EplApi.OnPostOpenProject");
            onPostOpenProject.EplanEvent +=
                new EventHandlerFunction(OnPostOpenProject);

            onMainEnd.SetEvent("Eplan.EplApi.OnMainEnd");
            onMainEnd.EplanEvent +=
                new EventHandlerFunction(OnMainEnd);

            onMainStart.SetEvent("Eplan.EplApi.OnMainStart");
            onMainStart.EplanEvent +=
                new EventHandlerFunction(OnMainStart);

            onNotifyPageChanged.SetEvent("NotifyPageOpened");
            onNotifyPageChanged.EplanEvent +=
                new EventHandlerFunction(OnNotifyPageChanged);

            IEplanHelper         eplanHelper         = new EplanHelper();
            IModuleConfiguration moduleConfiguration =
                new ModuleConfiguration();
            IRunningProcess runningProcess =
                new RunningProcess(Process.GetCurrentProcess());

            idleTimeModule = new IdleTimeModule.IdleTimeModule(
                eplanHelper, moduleConfiguration, runningProcess);
        }
        public bool OnInit()
        {
            IEplanHelper         eplanHelper         = new EplanHelper();
            IModuleConfiguration moduleConfiguration =
                new ModuleConfiguration();
            IRunningProcess runningProcess =
                new RunningProcess(Process.GetCurrentProcess());

            idleTimeModule = new IdleTimeModule(eplanHelper,
                                                moduleConfiguration, runningProcess);
            idleTimeModule.Start(OriginalAssemblyPath);
            return(true);
        }