コード例 #1
0
 protected void _SetFormulaIgnoreNull(StreamType st, SIDSRC streamitem, FormulaLiteral formula)
 {
     if (formula.HasValue)
     {
         this._SetFormula(st, streamitem, formula);
     }
 }
コード例 #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);
        }
コード例 #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;
 }
コード例 #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;
 }
コード例 #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));
            }
        }
コード例 #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);
        }
コード例 #7
0
        public void SetFormulaIgnoreNull(short id, SRC src, FormulaLiteral formula)
        {
            var sidsrc = new SIDSRC(id, src);

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

            this._SetFormula(StreamType.SIDSRC, streamitem, formula);
        }
コード例 #9
0
 public void SetFormula(SIDSRC streamitem, FormulaLiteral formula)
 {
     this._SetFormula(StreamType.SIDSRC, streamitem, formula);
 }
コード例 #10
0
 public void SetResult(SIDSRC streamitem, string value, IVisio.VisUnitCodes unitcode)
 {
     this._SetResult(StreamType.SIDSRC, streamitem, value, unitcode);
 }
コード例 #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);
        }
コード例 #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);
        }
コード例 #13
0
        public void AddCell(short id, VisioAutomation.ShapeSheet.SRC src)
        {
            var sidsrc = new VisioAutomation.ShapeSheet.SIDSRC(id, src);

            this.SIDSRCs.Add(sidsrc);
        }
コード例 #14
0
        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);
        }