Beispiel #1
0
 /// <summary>
 ///     Draws the respecting Icon for this cell
 /// </summary>
 public void DrawIcon()
 {
     if (control == null)
     {
         try
         {
             var container = new CellErrorInfoContainer();
             container.SuspendLayout();
             container.ElementHost.Child = new CellErrorInfo
             {
                 DataContext = this,
                 Visibility  = Visibility.Visible
             };
             container.ResumeLayout(true);
             var vsto = Globals.Factory.GetVstoObject(Worksheet);
             controlName    = Guid.NewGuid().ToString();
             control        = vsto.Controls.AddControl(container, Worksheet.Range[ShortLocation], controlName);
             control.Width  = 13;
             control.Height = 13;
         }
         catch (Exception e)
         {
             Debug.WriteLine(e);
         }
     }
 }
Beispiel #2
0
 /// <summary>
 /// Draws the respecting Icon for this cell
 /// </summary>
 private void DrawIcon()
 {
     try
     {
         var container = new CellErrorInfoContainer();
         container.SuspendLayout();
         container.ElementHost.Child = new CellErrorInfo
         {
             DataContext = this, Visibility = Visibility.Visible, Opacity = 1.00
         };
         container.ElementHost.Child.UpdateLayout();
         var vsto = Globals.Factory.GetVstoObject(Worksheet);
         controlName       = Guid.NewGuid().ToString();
         container.Visible = false;
         container.ResumeLayout(true);
         control           = vsto.Controls.AddControl(container, Worksheet.Range[ShortLocation], controlName);
         control.Visible   = false;
         control.Width     = control.Height + 4;
         control.Placement = XlPlacement.xlMoveAndSize;
         control.AutoLoad  = true;
         container.Visible = true;
     }
     catch (Exception ex)
     {
         Console.Out.WriteLine(ex.ToString());
     }
 }
Beispiel #3
0
        private void DrawIcon()
        {
            var container = new CellErrorInfoContainer();

            container.ElementHost.Child = new CellErrorInfo()
            {
                DataContext = this
            };

            var vsto = Globals.Factory.GetVstoObject(this.Worksheet);

            this.controlName = Guid.NewGuid().ToString();

            this.control           = vsto.Controls.AddControl(container, this.Worksheet.Range[this.ShortLocation], this.controlName);
            this.control.Width     = this.control.Height + 4;
            this.control.Placement = Microsoft.Office.Interop.Excel.XlPlacement.xlMove;
            this.control.AutoLoad  = true;
        }
Beispiel #4
0
        /// <summary>
        /// Renders the controls in the spreadsheet
        /// </summary>
        public override void CreateControls()
        {
            var container = new CellErrorInfoContainer();

            this.CellErrorInfo = new CellErrorInfo() { DataContext = this };
            container.ElementHost.Child = this.CellErrorInfo;

            var vsto = Globals.Factory.GetVstoObject(this.Cell.Worksheet);

            // Remove the old control
            if (!string.IsNullOrWhiteSpace(this.ControlName))
            {
                vsto.Controls.Remove(this.ControlName);
                this.ControlName = null;
            }

            this.ControlName = Guid.NewGuid().ToString();

            this.Control = vsto.Controls.AddControl(container, this.Cell.Worksheet.Range[this.Cell.ShortLocation], this.ControlName);
            this.Control.Width = this.Control.Height;
            this.Control.Placement = Microsoft.Office.Interop.Excel.XlPlacement.xlMove;
        }
Beispiel #5
0
        private void DrawIcon()
        {
            var container = new CellErrorInfoContainer();
            container.ElementHost.Child = new CellErrorInfo() 
            { 
                DataContext = this 
            };

            var vsto = Globals.Factory.GetVstoObject(this.Worksheet);

            this.controlName = Guid.NewGuid().ToString();

            this.control = vsto.Controls.AddControl(container, this.Worksheet.Range[this.ShortLocation], this.controlName);
            this.control.Width = this.control.Height + 4;
            this.control.Placement = Microsoft.Office.Interop.Excel.XlPlacement.xlMove;
            this.control.AutoLoad = true;
        }
Beispiel #6
0
 /// <summary>
 /// Draws the respecting Icon for this cell
 /// </summary>
 private void DrawIcon()
 {
     try
     {
         var container = new CellErrorInfoContainer();
         container.SuspendLayout();
         container.ElementHost.Child = new CellErrorInfo
         {
             DataContext = this, Visibility = Visibility.Visible, Opacity = 1.00
         };
         container.ElementHost.Child.UpdateLayout();
         var vsto = Globals.Factory.GetVstoObject(Worksheet);
         controlName = Guid.NewGuid().ToString();
         container.Visible = false;
         container.ResumeLayout(true);
         control = vsto.Controls.AddControl(container, Worksheet.Range[ShortLocation], controlName);
         control.Visible = false;
         control.Width = control.Height + 4;
         control.Placement = XlPlacement.xlMoveAndSize;
         control.AutoLoad = true;
         container.Visible = true;
     }
     catch (Exception ex)
     {
         Console.Out.WriteLine(ex.ToString());
     }
 }