Esempio n. 1
0
        /// <summary>
        /// On Addin start up
        /// </summary>
        public override void StartUp()
        {
            try
            {
                InitCultureReader();
                WaspCulture m_WaspCulture = null;
                if (m_WaspCulture == null)
                {
                    m_WaspCulture = this.CultureReader;
                }
                if (!string.IsNullOrEmpty(m_WaspCulture.GetResourceValue("clock")))
                {
                    addinName = m_WaspCulture.GetResourceValue("clock");
                }

                m_lstContainer = new List <IWContainer>();
                m_lstAddinInfo = new List <AddinInfo>();
                m_lstAddinInfo.Add(new AddinInfo()
                {
                    AddinType = "Clock", Button = true, ButtonCaption = addinName
                });


                //S.No.: -06

                //read culture file
            } //End(try)
            catch (Exception ex)
            {
                Beesys.Wasp.Workflow.LogWriter.WriteLog(ClockAddinConstants.MODULENAME, ex);
            }
        }//End(StartUp())
Esempio n. 2
0
        public void CleanUp() //S.No.: -			07
        {
            try
            {
                if (m_objSceneGraph != null)
                {
                    m_objSceneGraph = null;
                }
                if (m_ObjEngine != null)
                {
                    m_ObjEngine.m_evtEWEnginRenderInfo -= new dlgtOnEngineRenderInfo(m_ObjEngine_m_evtEWEnginPreRenderInfo);
                    m_ObjEngine = null;
                }

                if (m_dtClock != null)
                {
                    m_dtClock.Dispose(); //S.No.: -			07
                }
                m_dtClock     = null;
                m_objWService = null;

                m_sFormat         = null;
                m_sAddinType      = null;
                m_sTodaysFormat   = null;
                m_sTomorrowFormat = null;

                m_objTimeFormat  = null;
                m_objWaspCulture = null;
            }
            catch (Exception ex)
            {
                Beesys.Wasp.Workflow.LogWriter.WriteLog(ClockAddinConstants.MODULENAME, ex);
            }
        }
Esempio n. 3
0
 public TimeFormat(WaspCulture CultureReader)
 {
     InitializeComponent();
     if (CultureReader != null)
     {
         m_Culture = CultureReader;
     }
 }
Esempio n. 4
0
        //end (Service)
        #endregion

        #region Public Methods

        /// <summary>
        /// On addin button click or addin edit
        /// Opens form to select time format
        /// </summary>
        /// <param name="showDialog"></param>
        /// <returns></returns>
        public override DialogResult Editor(bool showDialog)
        {
            DialogResult objdialogrslt = DialogResult.None;

            try
            {
                if (showDialog)
                {
                    if (m_objWaspCulture == null)// S.No.: -06
                    {
                        if ((this.Provider as ClockAddInProvider) != null && (this.Provider as ClockAddInProvider).CultureReader != null)
                        {
                            m_objWaspCulture = (this.Provider as ClockAddInProvider).CultureReader;
                        }
                    }
                    if (m_objTimeFormat == null)// S.No.: -06
                    {
                        m_objTimeFormat      = new TimeFormat();
                        m_objTimeFormat.Dock = DockStyle.Fill;

                        m_objTimeFormat.Internationalization(m_objWaspCulture);

                        if (!string.IsNullOrEmpty(this.Provider.CurrentCulture) && (m_objTimeFormat is UCBaseEngineAddin))
                        {
                            (m_objTimeFormat as UCBaseEngineAddin).AssemblyPath = (this.Provider as ClockAddInProvider).AssemblyPath;

                            (m_objTimeFormat as UCBaseEngineAddin)._Culture = this.Provider.CurrentCulture;
                        }
                        m_objTimeFormat.InitHelp(Service);// S.No.: -06
                    }

                    if (m_FrmBaseEngineAddin == null)// S.No.: -06
                    {
                        m_FrmBaseEngineAddin = new FrmBaseEngineAddin();
                        if (!(this.Provider as ClockAddInProvider).CultureReader.FileExist)
                        {
                            m_FrmBaseEngineAddin.Text = "Time Format";
                        }
                        m_FrmBaseEngineAddin.Internationalization(m_objWaspCulture, (this.Provider as ClockAddInProvider).CultureReader.GetResourceValue("CaptionTimeFormat"));
                        m_FrmBaseEngineAddin.AddControl(m_objTimeFormat);
                    }
                    m_objTimeFormat.Format = Config;
                    objdialogrslt          = m_FrmBaseEngineAddin.ShowDialog();

                    if (objdialogrslt == DialogResult.OK)// S.No.: -06
                    {
                        m_sFormat         = m_objTimeFormat.CurrentTimeFormat;
                        m_sTodaysFormat   = m_objTimeFormat.TodaysFormat;
                        m_sTomorrowFormat = m_objTimeFormat.TomorrowFormat;
                        Config            = m_sFormat + "," + m_sTodaysFormat + "," + m_sTomorrowFormat;
                        SetValue(Config);
                        UpdateTime(true);
                    }
                    m_FrmBaseEngineAddin.Close();
                }
                else
                {
                    SetValue(Config);

                    UpdateTime(true);
                }
                return(objdialogrslt);
            }

            catch (Exception ex)
            {
                BeeSys.Wasp3D.Hosting.LogWriter.WriteLog(ex);
                return(objdialogrslt);
            }
            finally
            {
                m_FrmBaseEngineAddin = null;
                m_objTimeFormat      = null;
            }
        }
Esempio n. 5
0
        /// <summary>
        ///  S.No.: -			05
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //end (ShutDown)
        public override void  Internationalization(WaspCulture CultureReader)//S.No.: -06
        {
            try
            {
                dataGridView1.ColumnHeadersDefaultCellStyle.Font = new Font(dataGridView1.ColumnHeadersDefaultCellStyle.Font, FontStyle.Bold);

                m_Culture = CultureReader;
                m_dtClock = new DataTable();
                m_dtClock.Columns.Add(ClockAddinConstants.TIME);
                m_dtClock.Columns.Add(ClockAddinConstants.HOUR);
                m_dtClock.Columns.Add(ClockAddinConstants.MINUTE);
                m_dtClock.Columns.Add(ClockAddinConstants.SECOND);
                DataRow dr = m_dtClock.NewRow();
                m_dtClock.Rows.Add(dr);
                dataGridView1.DataSource = m_dtClock;
                if (CultureReader != null && CultureReader.FileExist)
                {
                    dataGridView1.DataSource = m_dtClock;

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("timeformat")))
                    {
                        _timeFormat = CultureReader.GetResourceValue("timeformat");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("tomorrowDateFormat")))
                    {
                        _tomorrowDateFormat = CultureReader.GetResourceValue("tomorrowDateFormat");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("todayDateFormat")))
                    {
                        _todayDateFormat = CultureReader.GetResourceValue("todayDateFormat");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("description")))
                    {
                        _description = CultureReader.GetResourceValue("description");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("time")))
                    {
                        _time = CultureReader.GetResourceValue("time");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("hour")))
                    {
                        _hour = CultureReader.GetResourceValue("hour");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("minute")))
                    {
                        _minute = CultureReader.GetResourceValue("minute");
                    }

                    if (!string.IsNullOrEmpty(CultureReader.GetResourceValue("second")))
                    {
                        _second = CultureReader.GetResourceValue("second");
                    }
                }
                lblTimeFormat.Text     = _timeFormat;
                lblTmrwTimeFrmt.Text   = _tomorrowDateFormat;
                lblTodaysTimeFrmt.Text = _todayDateFormat;
                dataGridView1.Columns[0].HeaderText = _time;
                dataGridView1.Columns[1].HeaderText = _hour;
                dataGridView1.Columns[2].HeaderText = _minute;
                dataGridView1.Columns[3].HeaderText = _second;
            }
            catch (Exception ex)
            {
                Workflow.LogWriter.WriteLog(ex);
            }
            finally
            {
            }
        }