Exemplo n.º 1
0
        private void SwitchWForm()
        {
            bool isMini = this.WindowState == FormWindowState.Minimized;

            if (!isMini)
            {
                //to set shotcut params
                try
                {
                    lock (spm)
                    {
                        spm                       = new SnapModel();
                        spm.IsFileSave            = cbIsSaveToFile.Checked;
                        spm.FSavePam.IsAutoSave   = cbIsAutoSave.Checked;
                        spm.FSavePam.FileAutoPath = txtAutoSavePath.Text;
                        spm.FSavePam.FileAutoName = txtAutoSavePreFileName.Text;
                    }
                }
                catch (Exception ex)
                {
                    LogFile.Log(this, new
                    {
                        IsFileSave   = cbIsSaveToFile.Checked,
                        IsAutoSave   = cbIsAutoSave.Checked,
                        FileAutoPath = txtAutoSavePath.Text,
                        FileAutoName = txtAutoSavePreFileName.Text
                    }, "Errors in setting params for snapscreen.", ex, enLogLevel.High);
                }
            }
            this.Visible     = !isMini ? false : true;
            this.WindowState = !isMini ? FormWindowState.Minimized : FormWindowState.Normal;
        }
Exemplo n.º 2
0
        protected void SetSnapTemplate()
        {
            foreach (DictionaryEntry dic in SnapManager.GetInstance().SnapCollection)
            {
                SnapModel snapModel = SnapManager.GetInstance().SnapCollection[dic.Key.ToString()];
                if (string.IsNullOrEmpty(snapModel.ViewControl))
                {
                    continue;
                }

                UmcContentsCommonPage template = (UmcContentsCommonPage)LoadControl(snapModel.ViewControl.ToString());
                template.SnapModel = snapModel;

                //if (FindControl("ph_" + snapModel.ID.ToString()) == null) return;
                //((PlaceHolder)FindControl("ph_" + snapModel.ID.ToString()))
                //    .Controls.Add(template);

                if (FindControl("phSnaps") == null)
                {
                    return;
                }

                ((PlaceHolder)FindControl("phSnaps")).Controls.Add(template);

                if (!IsPostBack)
                {
                    //if (FindControl("snap_" + snapModel.ID.ToString()) == null) return;
                    ComponentArt.Web.UI.Snap snapTemplate = (ComponentArt.Web.UI.Snap)template.FindControl("snap_" + snapModel.ID.ToString());
                    SnapManager.GetInstance().LoadSnap(snapTemplate, Context);
                }
            }
        }
Exemplo n.º 3
0
 public MainForm()
 {
     InitializeComponent();
     try
     {
         spm = new SnapModel();
     }
     catch (Exception ex)
     {
         LogFile.Log(this, new { Param = "Init SnapModel Error." }, "Init SnapModel Error.", ex, enLogLevel.High);
         Close();
     }
 }
Exemplo n.º 4
0
 public MainForm() : base()
 {
     InitializeComponent();
     try
     {
         spm = new SnapModel();
     }
     catch (Exception ex)
     {
         LogFile.Log(this, new { Param = "Init SnapModel Error." }, "Init SnapModel Error.", ex, enLogLevel.High);
         Close();
     }
     if (!AddToRegistered(this))
     {
         LogFile.Log(this, new { Param = "no Params" }, "MainForm has registered.", new Exception("MainForm has registered."), enLogLevel.High);
         isClose = true;
         Close();
     }
 }