Esempio n. 1
0
        /// <summary>
        ///     Creates a reference to a range of rows on a given sheet
        /// </summary>
        /// <param name="sheet">The sheet the reference will use</param>
        /// <param name="start">The top row of the range</param>
        /// <param name="finish">The bottom row of the range</param>
        /// <returns>A sheet reference to the range of rows on the given sheet</returns>
        /// <remarks>
        ///     This method will create a sheet reference to an entire range of rows on the given sheet.  Use it when
        ///     you wish to reference entire rows and have the two indices handy.
        /// </remarks>
        /// <exception cref="T:System.ArgumentException">
        ///     <para>The resultant range is not within the bounds of the given sheet</para>
        ///     <para>The given sheet argument is not registered with the SheetManager</para>
        /// </exception>
        /// <example>
        ///     The following example creates a reference to rows 5 through 7 on the currently active sheet
        ///     <code>
        /// Dim engine As New FormulaEngine
        /// Dim ref As ISheetReference = engine.ReferenceFactory.Rows(5, 7)
        /// </code>
        /// </example>
        public ISheetReference Rows(ISheet sheet, int start, int finish)
        {
            FormulaEngine.ValidateNonNull(sheet, "sheet");
            var @ref = new RowReference(start, finish);

            InitializeGridReference(@ref, sheet);
            return(@ref);
        }
Esempio n. 2
0
 public static bool IsLocal(this RowReference reference, Process process)
 {
     if (reference.Participant.Location.IpAddress == process.GetLocation().IpAddress&& reference.Participant.Location.PortNumber == process.GetLocation().PortNumber)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 3
0
        public IEnumerable <RowWithStopCondition> GetRowsWithStopConditions()
        {
            foreach (KeyValuePair <RowReference, StopInfo> pair
                     in _rowsWithStopConditions)
            {
                RowReference rowReference = pair.Key;
                StopInfo     stopInfo     = pair.Value;

                yield return(new RowWithStopCondition(rowReference.TableName,
                                                      rowReference.OID,
                                                      stopInfo));
            }
        }
Esempio n. 4
0
        public void Add([NotNull] string tableName,
                        int objectID,
                        [NotNull] StopInfo stopInfo)
        {
            var rowReference = new RowReference(tableName, objectID);

            if (_rowsWithStopConditions.ContainsKey(rowReference))
            {
                return;
            }

            _rowsWithStopConditions.Add(rowReference, stopInfo);
        }
Esempio n. 5
0
        public static Row GetData(this RowReference reference)
        {
            //Guid? id = reference.Id;

            /*
             * write whatever logic needed here to connect to the remote location
             * for this row
             * and get the row based on the reference.Id
             * will likely need a reference to the comm service to get data in
             * an async manner
             */

            throw new NotImplementedException();
        }
Esempio n. 6
0
        public StopInfo GetStopInfo([NotNull] IRow row)
        {
            if (!row.HasOID)
            {
                return(null);
            }

            var rowReference = new RowReference(DatasetUtils.GetName(row.Table), row.OID);

            StopInfo stopInfo;

            return(_rowsWithStopConditions.TryGetValue(rowReference, out stopInfo)
                                       ? stopInfo
                                       : null);
        }
Esempio n. 7
0
 private SheetReference TryParseGridReference(string s)
 {
     if (CellReference.IsValidString(s))
     {
         return(CellReference.FromString(s));
     }
     if (CellRangeReference.IsValidString(s))
     {
         return(CellRangeReference.FromString(s));
     }
     if (ColumnReference.IsValidString(s))
     {
         return(ColumnReference.FromString(s));
     }
     if (RowReference.IsValidString(s))
     {
         return(RowReference.FromString(s));
     }
     return(null);
 }
Esempio n. 8
0
 public override Reference CreateReference()
 {
     return(RowReference.FromString(_image));
 }