コード例 #1
0
ファイル: MyGenError.cs プロジェクト: aqzou/MyGeneration
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Date: ").AppendLine(this.DateTimeOccurred.ToString());
            if (TemplateFileName != null)
            {
                sb.Append("TemplateFileName: ").AppendLine(TemplateFileName);
            }
            if (TemplateIdentifier != null)
            {
                sb.Append("TemplateIdentifier: ").AppendLine(TemplateIdentifier);
            }
            sb.Append("Class: ").AppendLine(Class.ToString());
            sb.Append("IsWarning: ").AppendLine(IsWarning.ToString());
            sb.Append("IsRuntime: ").AppendLine(IsRuntime.ToString());
            sb.Append("IsTemplateCodeSegment: ").AppendLine(IsTemplateCodeSegment.ToString());
            if (ErrorNumber != null)
            {
                sb.Append("ErrorNumber: ").AppendLine(ErrorNumber);
            }
            if (ErrorType != null)
            {
                sb.Append("ErrorType: ").AppendLine(ErrorType);
            }
            if (SourceFile != null)
            {
                sb.Append("SourceFile: ").AppendLine(SourceFile);
            }
            if (SourceLine != null)
            {
                sb.Append("SourceLine: ").AppendLine(SourceLine);
            }
            sb.Append("LineNumber: ").AppendLine(LineNumber.ToString());
            sb.Append("ColumnNumber: ").AppendLine(ColumnNumber.ToString());
            if (Message != null)
            {
                sb.Append("Message: ").AppendLine(Message);
            }
            if (Detail != null)
            {
                sb.Append("Detail: ").AppendLine(Detail);
            }
            return(sb.ToString());
        }
コード例 #2
0
        internal Dictionary <string, string> GetProperties()
        {
            var properties = new Dictionary <string, string>();

            if (!string.IsNullOrWhiteSpace(SourcePath))
            {
                properties.Add("sourcepath", SourcePath);
            }
            if (LineNumber.HasValue)
            {
                properties.Add("linenumber", LineNumber.ToString());
            }
            if (ColumnNumber.HasValue)
            {
                properties.Add("columnnumber", ColumnNumber.ToString());
            }
            if (ErrorCode.HasValue)
            {
                properties.Add("code", ErrorCode.ToString());
            }
            return(properties);
        }
コード例 #3
0
 /// <summary>
 ///    <para>
 ///       Gets the row number and column number of the cell.
 ///    </para>
 /// </summary>
 public override string ToString()
 {
     return("DataGridCell {RowNumber = " + RowNumber.ToString(CultureInfo.CurrentCulture) +
            ", ColumnNumber = " + ColumnNumber.ToString(CultureInfo.CurrentCulture) + "}");
 }
コード例 #4
0
ファイル: Calculator.cs プロジェクト: jsuen123/openpetragit
        /// <summary>
        /// This procedure uses the calculation columns,
        /// and splits them each up into 12 columns, for each period
        ///
        /// </summary>
        /// <returns>void</returns>
        protected void InitMultiPeriodColumns()
        {
            System.Int32   MaxDisplayColumns;
            System.Int32   NumberColumns;
            System.Int32   Counter;
            System.Int32   Month;
            System.Int32   NewColumn;
            TParameterList TempParameters;
            String         Formula;

            System.Int32 CurrentPos;
            System.Int32 NumberPos;
            System.Int32 ColumnNumber;
            String       Numberstring;

            // then each column must be written back, 12 times
            // the references must be changed to other columns
            // what about ledger sums, etc?
            MaxDisplayColumns = Parameters.Get("MaxDisplayColumns").ToInt();
            NumberColumns     = MaxDisplayColumns;

            while (Parameters.Exists("param_calculation", NumberColumns))
            {
                NumberColumns = NumberColumns + 1;
            }

            // the current column calculation settings must be saved somewhere
            TempParameters = new TParameterList();

            for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
            {
                TempParameters.Copy(Parameters, Counter, -1, eParameterFit.eBestFit, -1);
            }

            // clear the current column settings
            for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
            {
                Parameters.RemoveColumn(Counter);
            }

            for (Counter = 0; Counter <= NumberColumns - 1; Counter++)
            {
                for (Month = 1; Month <= 12; Month++)
                {
                    NewColumn = Counter * 13 + Month - 1;
                    Parameters.Copy(TempParameters, Counter, -1, eParameterFit.eExact, NewColumn);
                    Parameters.Add("param_column_period_i", new TVariant(Month), NewColumn);
                    Parameters.Add("param_start_period_i", new TVariant(Month), NewColumn);
                    Parameters.Add("param_end_period_i", new TVariant(Month), NewColumn);
                    Parameters.Add("param_ytd", new TVariant(false), NewColumn);

                    if (Parameters.Exists("FirstColumn", NewColumn))
                    {
                        Parameters.Add("FirstColumn", new TVariant(Parameters.Get("FirstColumn", NewColumn).ToInt() * 13 + Month - 1), NewColumn);
                    }

                    if (Parameters.Exists("SecondColumn", NewColumn))
                    {
                        Parameters.Add("SecondColumn", new TVariant(Parameters.Get("SecondColumn", NewColumn).ToInt() * 13 + Month - 1), NewColumn);
                    }

                    if (Parameters.Exists("param_formula", NewColumn))
                    {
                        Formula = Parameters.Get("param_formula", NewColumn).ToString();

                        // replace column(x) with column(mul(13,x))
                        CurrentPos = 0;
                        CurrentPos = Formula.ToLower().IndexOf("column(", CurrentPos);

                        while (CurrentPos != -1)
                        {
                            NumberPos    = CurrentPos + ("column(").Length;
                            Numberstring = Formula.Substring(NumberPos, Formula.IndexOf(')', NumberPos) - NumberPos);
                            ColumnNumber = Convert.ToInt32(Numberstring);
                            Formula      =
                                Formula.Substring(0,
                                                  NumberPos) + "mul(13," + ColumnNumber.ToString() + ')' + Formula.Substring(Formula.IndexOf(')', NumberPos));
                            CurrentPos = Formula.ToLower().IndexOf("column(", CurrentPos + 1);
                        }

                        Parameters.Add("param_formula", new TVariant(Formula), NewColumn);
                    }
                }

                // the ytd column
                NewColumn = Counter * 13 + 12;
                Parameters.Copy(TempParameters, Counter, -1, eParameterFit.eExact, NewColumn);
                Parameters.Add("param_column_period_i", new TVariant(12), NewColumn);
                Parameters.Add("param_ytd", new TVariant(true), NewColumn);

                // TODO: also apply the formula/ reference changes to columns!!!!
            }

            Parameters.Add("MaxDisplayColumns", NumberColumns * 13);
        }
コード例 #5
0
 /// <include file='doc\DataGridCell.uex' path='docs/doc[@for="DataGridCell.ToString"]/*' />
 /// <devdoc>
 ///    <para>
 ///       Gets the row number and column number of the cell.
 ///    </para>
 /// </devdoc>
 public override string ToString()
 {
     return("DataGridCell {RowNumber = " + RowNumber.ToString() +
            ", ColumnNumber = " + ColumnNumber.ToString() + "}");
 }
コード例 #6
0
 public string ToShortString()
 {
     return($"{ZoomLevel.ToString(CultureInfo.InvariantCulture)}, {RowNumber.ToString(CultureInfo.InvariantCulture)}, {ColumnNumber.ToString(CultureInfo.InvariantCulture)}");
 }