Example #1
0
 protected void _SetFormulaIgnoreNull(StreamType st, SIDSRC streamitem, FormulaLiteral formula)
 {
     if (formula.HasValue)
     {
         this._SetFormula(st, streamitem, formula);
     }
 }
Example #2
0
        protected void _SetFormula(StreamType st, SIDSRC streamitem, FormulaLiteral formula)
        {
            this.CheckFormulaIsNotNull(formula.Value);
            var rec = new UpdateRecord(st, streamitem, formula.Value);

            this._add_update(rec);
        }
Example #3
0
 internal UpdateRecord(StreamType st, SIDSRC sidsrc, string result, IVisio.VisUnitCodes unit_code)
 {
     this.SIDSRC        = sidsrc;
     this.Formula       = null;
     this.UnitCode      = unit_code;
     this.ResultNumeric = 0.0;
     this.ResultString  = result;
     this.UpdateType    = UpdateType.ResultString;
     this.StreamType    = st;
 }
Example #4
0
 internal UpdateRecord(StreamType st, SIDSRC sidsrc, string formula)
 {
     this.SIDSRC        = sidsrc;
     this.Formula       = formula;
     this.ResultNumeric = 0.0;
     this.ResultString  = null;
     this.UnitCode      = IVisio.VisUnitCodes.visNumber;
     this.UpdateType    = UpdateType.Formula;
     this.StreamType    = st;
 }
Example #5
0
        private short [] build_stream()
        {
            var st = this._first_update.Value.StreamType;

            if (st == StreamType.SRC)
            {
                var streamb = new List <SRC>(this._updates.Count);
                streamb.AddRange(this._updates.Select(i => i.SIDSRC.SRC));
                return(SRC.ToStream(streamb));
            }
            else
            {
                var streamb = new List <SIDSRC>(this._updates.Count);
                streamb.AddRange(this._updates.Select(i => i.SIDSRC));
                return(SIDSRC.ToStream(streamb));
            }
        }
Example #6
0
        public void PasteFormat(IVisio.Page page, IList <int> shapeids, FormatCategory category, bool applyformulas)
        {
            // Find all the cells that are going to be pasted
            var matching_cells = this.Cells.Where(c => c.MatchesCategory(category)).ToArray();

            // Apply those matched cells to each shape
            var writer = new FormulaWriterSIDSRC();

            foreach (var shape_id in shapeids)
            {
                foreach (var cell in matching_cells)
                {
                    var sidsrc      = new VisioAutomation.ShapeSheet.SIDSRC((short)shape_id, cell.SRC);
                    var new_formula = applyformulas ? cell.Formula : cell.Result;
                    writer.SetFormula(sidsrc, new_formula);
                }
            }

            writer.Commit(page);
        }
Example #7
0
        public void SetFormulaIgnoreNull(short id, SRC src, FormulaLiteral formula)
        {
            var sidsrc = new SIDSRC(id, src);

            this._SetFormulaIgnoreNull(StreamType.SIDSRC, sidsrc, formula);
        }
Example #8
0
        public void SetFormula(short shapeid, SRC src, FormulaLiteral formula)
        {
            var streamitem = new SIDSRC(shapeid, src);

            this._SetFormula(StreamType.SIDSRC, streamitem, formula);
        }
Example #9
0
 public void SetFormula(SIDSRC streamitem, FormulaLiteral formula)
 {
     this._SetFormula(StreamType.SIDSRC, streamitem, formula);
 }
Example #10
0
 public void SetResult(SIDSRC streamitem, string value, IVisio.VisUnitCodes unitcode)
 {
     this._SetResult(StreamType.SIDSRC, streamitem, value, unitcode);
 }
Example #11
0
        public void SetResult(short shapeid, SRC src, string value, IVisio.VisUnitCodes unitcode)
        {
            var streamitem = new SIDSRC(shapeid, src);

            this._SetResult(StreamType.SIDSRC, streamitem, value, unitcode);
        }
Example #12
0
        protected void _SetResult(StreamType st, SIDSRC streamitem, string value, IVisio.VisUnitCodes unitcode)
        {
            var rec = new UpdateRecord(st, streamitem, value, unitcode);

            this._add_update(rec);
        }
Example #13
0
        public void AddCell(short id, VisioAutomation.ShapeSheet.SRC src)
        {
            var sidsrc = new VisioAutomation.ShapeSheet.SIDSRC(id, src);

            this.SIDSRCs.Add(sidsrc);
        }
        public void SetFormula(short id, VisioAutomation.ShapeSheet.SRC src, string formula)
        {
            var sidsrc = new VisioAutomation.ShapeSheet.SIDSRC(id, src);

            this.formula_writer.SetFormula(sidsrc, formula);
        }