Exemple #1
0
        public void LoadControls()
        {
            isLoading = true;
            logConfig = viewAdapter.LogConfig;
            if (logConfig.LoggingBehavior.Equals(CMSLogBehavior.NoLogging))
            {
                this.radioButtonNone.Checked = true;
            }
            else if (logConfig.LoggingBehavior.Equals(CMSLogBehavior.OnlyInfrequentLogging))
            {
                this.radioButtonSparse.Checked = true;
            }
            else if (logConfig.LoggingBehavior.Equals(CMSLogBehavior.AllSmallMessages))
            {
                this.radioButtonRegular.Checked = true;
            }
            else if (logConfig.LoggingBehavior.Equals(CMSLogBehavior.FullLogging))
            {
                this.radioButtonFull.Checked = true;
            }

            this.textBoxServerUrl.Text           = logConfig.LogServer;
            this.textBoxProxyUrl.Text            = logConfig.ProxyServer;
            this.textBoxProxyUsername.Text       = logConfig.ProxyUsername;
            this.textBoxProxyPassword.Text       = logConfig.ProxyPassword;
            this.checkBoxEnablPCMessages.Checked = logConfig.EnablePCMessages;

            if (idConfig != null)
            {
                buttonViewConsent.Visible = !idConfig.NotStudy;
            }
            isLoading = false;
        }
 public void UpdateUserControlledLogConfigInfo(CMSLogConfig logConfig)
 {
     LogServer        = logConfig.LogServer;
     EnablePCMessages = logConfig.EnablePCMessages;
     LoggingBehavior  = logConfig.LoggingBehavior;
     ProxyServer      = logConfig.ProxyServer;
     ProxyUsername    = logConfig.ProxyUsername;
     ProxyPassword    = logConfig.ProxyPassword;
 }
Exemple #3
0
        public void Init(CMSViewAdapter viewAdapter)
        {
            this.viewAdapter = viewAdapter;
            this.idConfig    = viewAdapter.IdentificationConfig;
            this.logConfig   = viewAdapter.LogConfig;

            adultConsentControl              = new AdultConsentControl();
            adultConsentControl.IdConfig     = idConfig;
            adultConsentControl.AgreeClick  += new EventHandler(adultConsentControl_AgreeClick);
            adultConsentControl.GoBackClick += new EventHandler(adultConsentControl_GoBackClick);

            idControl              = new IdentificationControl();
            idControl.IdConfig     = idConfig;
            idControl.OkClick     += new EventHandler(idControl_OkClick);
            idControl.CancelClick += new EventHandler(idControl_CancelClick);

            loggingControl = new LoggingControl();
            loggingControl.Init();
            loggingControl.OkClick           += new EventHandler(loggingControl_OkClick);
            loggingControl.PersonalInfoClick += new EventHandler(loggingControl_PersonalInfoClick);
            loggingControl.ViewConsentClick  += new EventHandler(loggingControl_ViewConsentClick);
            loggingControl.ViewAdapter        = viewAdapter;
            loggingControl.LoadControls();

            childConsentControl              = new ChildAssentControl();
            childConsentControl.AgreeClick  += new EventHandler(childConsentControl_AgreeClick);
            childConsentControl.GoBackClick += new EventHandler(childConsentControl_GoBackClick);
            childConsentControl.IdConfig     = idConfig;

            parentConsentControl              = new ParentConsentControl();
            parentConsentControl.AgreeClick  += new EventHandler(parentConsentControl_AgreeClick);
            parentConsentControl.GoBackClick += new EventHandler(parentConsentControl_GoBackClick);
            parentConsentControl.IdConfig     = idConfig;

            researchControl             = new ParticipationRequestControl();
            researchControl.AgreeClick += new EventHandler(researchControl_AgreeClick);

            LoggingInfoState state = CurState;

            if (state.Equals(LoggingInfoState.None))
            {
                SetPage(LoggingInfoCurPage.ResearchIntroPage);
            }
            else if (state.Equals(LoggingInfoState.PersonalInfoEntered))
            {
                SetPage(LoggingInfoCurPage.PersonalIdPage);
            }
            else if (state.Equals(LoggingInfoState.HasConsent))
            {
                SetPage(LoggingInfoCurPage.LogginPage);
            }
        }
Exemple #4
0
 public static void Init(CMSLogConfig logConfig, CMSIdentificationConfig idConfig)
 {
     logger           = new CMSLogger();
     logger.LogConfig = logConfig;
     logger.IdConfig  = idConfig;
     System.Collections.IDictionary environment = Environment.GetEnvironmentVariables();
     if (environment.Contains("DateTimeSendPeriod"))
     {
         long sendPeriod = Int32.Parse(Environment.GetEnvironmentVariables()["DateTimeSendPeriod"] as string);
         logger.DateTimeStampWaitPeriodMillis = sendPeriod;
     }
     if (environment.Contains("NeverConnect"))
     {
         bool neverConnect = Boolean.Parse(Environment.GetEnvironmentVariables()["NeverConnect"] as string);
         logger.NeverConnect = neverConnect;
     }
     logger.Update();
 }
Exemple #5
0
        private void LoadLogConfig()
        {
            bool generateFile = true;

            if (File.Exists(logConfigFile))
            {
                try
                {
                    generateFile = false;
                    TextReader    tr    = new StreamReader(logConfigFile);
                    XmlSerializer xmSer = new XmlSerializer(typeof(CMSLogConfig));
                    logConfig = (CMSLogConfig)xmSer.Deserialize(tr);
                    tr.Close();
                }
                catch
                {
                    generateFile = true;
                    try
                    {
                        File.Delete(logConfigFile);
                    }
                    catch
                    {
                    }
                }
            }

            if (generateFile)
            {
                logConfig = new CMSLogConfig();

                try
                {
                    FileStream    fs    = new FileStream(logConfigFile, FileMode.Create, FileAccess.ReadWrite, FileShare.Delete | FileShare.ReadWrite);
                    TextWriter    tw    = new StreamWriter(fs);
                    XmlSerializer xmSer = new XmlSerializer(typeof(CMSLogConfig));
                    xmSer.Serialize(tw, logConfig);
                    tw.Close();
                }
                catch
                {
                }
            }
        }
        public CMSLogConfig Clone()
        {
            CMSLogConfig logConfig = new CMSLogConfig();

            logConfig.MBLimitLogDirectory     = MBLimitLogDirectory;
            logConfig.MBLimitLogFile          = MBLimitLogFile;
            logConfig.LogServer               = LogServer;
            logConfig.EnablePCMessages        = EnablePCMessages;
            logConfig.LoggingBehavior         = LoggingBehavior;
            logConfig.ProxyServer             = ProxyServer;
            logConfig.ProxyUsername           = ProxyUsername;
            logConfig.ProxyPassword           = ProxyPassword;
            logConfig.MaxNumLogEventInMessage = MaxNumLogEventInMessage;
            logConfig.MaxNumLogEventInMemory  = MaxNumLogEventInMemory;
            logConfig.LogEventWaitTime        = LogEventWaitTime;
            logConfig.FileMonitorWaitTime     = FileMonitorWaitTime;
            logConfig.ReconnectTiming         = ReconnectTiming;
            logConfig.Uid        = Uid;
            logConfig.SessionNum = SessionNum;
            return(logConfig);
        }
 public CMSLogBehaviorEvent(CMSLogConfig config)
 {
     enablePCMessages = config.EnablePCMessages;
     behavior         = config.LoggingBehavior;
 }