Exemplo n.º 1
0
        /// <summary>
        /// Functional Designer. Use this one.
        /// </summary>
        /// <param name="designMode">if true we're on a workspace designer</param>
        /// <param name="globalContext">info about the session</param>
        /// <param name="recordContext">info about the workspace/record</param>
        public CopyDetailsButton(bool designMode, IGlobalContext globalContext, IRecordContext recordContext)
        {
            try
            {
                if (!designMode)
                {
                    recordContext.Saved += new EventHandler(recordContext_Saved);
                }

                //create a logic controller
                logic = new CopyDetailsLogic(designMode, globalContext, recordContext);
                this.globalContext = globalContext;
                this.recordContext = recordContext;

                //set up the UI
                InitializeComponent();

                //load the button text from the server settings
                button_copy.Text = ServerSettings.Instance.ButtonLabel;
            }
            catch (Exception ex)
            {
                MessageBox.Show("Error: " + ex.Message);
                globalContext.LogMessage("Incident Copy Addin - Exception: " + ex.ToString());
                this.Enabled = false;
            }
        }
Exemplo n.º 2
0
 void recordContext_Saved(object sender, EventArgs e)
 {
     logic = new CopyDetailsLogic(false, globalContext, recordContext);
 }