/// <summary>
        ///
        /// </summary>
        public LocalRibbon()
        {
            StringBuilder sbTrace = new StringBuilder();

            try
            {
                sbTrace.AppendLine("Start");
                Logger.SaveLoggerTrace(sbTrace);
                form = ADLSNumberingForm.GetInstance();
                //  System.Threading.Tasks.Task.Factory.StartNew(() => fun());
            }
            catch (Exception ex)
            {
                sbTrace.Clear();
                sbTrace.AppendLine("Exception" + ex);
                Logger.SaveLoggerTrace(sbTrace);
                Logger.LogWriter(ex.StackTrace);
            }
            finally
            {
                sbTrace.Clear();
                sbTrace.AppendLine("End");
                Logger.SaveLoggerTrace(sbTrace);
            }
        }
示例#2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OK_Button_Click(object sender, EventArgs e)
        {
            StringBuilder sbTrace = new StringBuilder();

            try
            {
                sbTrace.AppendLine("Start");
                Logger.SaveLoggerTrace(sbTrace);

                LocalRibbon tObj = new LocalRibbon();
                tObj.ParNumValues();
                ADLSNumberingForm form = ADLSNumberingForm.GetInstance();
                form.Hide();
            }
            catch (Exception ex)
            {
                sbTrace.Clear();
                sbTrace.AppendLine("Exception" + ex);
                Logger.SaveLoggerTrace(sbTrace);
                Logger.LogWriter(ex.StackTrace);
            }
            finally
            {
                sbTrace.Clear();
                sbTrace.AppendLine("End");
                Logger.SaveLoggerTrace(sbTrace);
            }
        }
示例#3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public static ADLSNumberingForm GetInstance()
 {
     if (_instance == null)
     {
         _instance = new ADLSNumberingForm();
     }
     return(_instance);
 }
        /// <summary>
        /// Call OnNumberingButton Method
        /// </summary>
        /// <param name="control"></param>
        public void OnNumberingButton(Office.IRibbonControl control)
        {
            StringBuilder sbTrace = new StringBuilder();

            try
            {
                sbTrace.AppendLine("Start");
                Logger.SaveLoggerTrace(sbTrace);
                form = ADLSNumberingForm.GetInstance();
                if (!form.Visible)
                {
                    form.Show();
                }
                else
                {
                    form.BringToFront();
                }
                var cntls = GetAll(form, typeof(RadioButton));
                foreach (Control cntrl in cntls)
                {
                    RadioButton _rb = (RadioButton)cntrl;
                    if (_rb.Checked)
                    {
                        _rb.Checked = false;
                    }
                }
            }
            catch (Exception ex)
            {
                sbTrace.Clear();
                sbTrace.AppendLine("Exception" + ex);
                Logger.SaveLoggerTrace(sbTrace);
                Logger.LogWriter(ex.StackTrace);
            }
            finally
            {
                sbTrace.Clear();
                sbTrace.AppendLine("End");
                Logger.SaveLoggerTrace(sbTrace);
            }
        }