Exemplo n.º 1
0
 private void SetCellValue(int i_Row, int i_Col, object i_Value, FormatTypes i_Type)
 {
     if (i_Value != null)
     {
         this.PrintingTable.GetCell(i_Row, i_Col).Text = this.FormatValue(i_Value, i_Type);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Adds an entry to the chat history box.
        /// </summary>
        /// <param name="text">The text to be added.</param>
        private void UpdateChatHistory(string text, FormatTypes formatType)
        {
            //  This code block ensures optimum line spacing between different types of formatted texts.
            switch (lastFormatType)
            {
            case FormatTypes.Status:
                if (formatType != FormatTypes.Status)
                {
                    rtbMessageHistory.AppendTextAsRtf("\n");
                }
                break;

            case FormatTypes.Message:
                if (formatType != FormatTypes.UserName)
                {
                    rtbMessageHistory.AppendTextAsRtf("\n");
                }
                break;
            }
            lastFormatType = formatType;

            //  Ensure there is no more than one blank line between messages.
            if (text.StartsWith(Environment.NewLine))
            {
                if (rtbMessageHistory.Text.EndsWith("\n\n"))
                {
                    text = text.TrimStart(Environment.NewLine.ToCharArray());
                }
            }

            switch (formatType)
            {
            case FormatTypes.UserName:
            case FormatTypes.Status:
                rtbMessageHistory.AppendTextAsRtf(text, Definitions.GetPresetFont(formatType), Definitions.GetPresetColor(formatType));
                break;

            case FormatTypes.Message:
                string rtfText = DecodeEmoticons(text);
                rtfText = rtfText.Insert(rtfText.LastIndexOf(@"\f0"), @"\li240");
                rtbMessageHistory.AppendRtf(rtfText);

                //  Enable button that saves chat history.
                if (!bCanSave && rtbMessageHistory.TextLength > 0)
                {
                    tbBtnSave.Enabled = true;
                    bCanSave          = true;
                }
                break;

            default:
                rtbMessageHistory.AppendTextAsRtf(text);
                break;
            }

            //  For auto scrolling chat history box.
            rtbMessageHistory.ScrollToBottom();
        }
Exemplo n.º 3
0
 public static IFeedFormatter GetFormatter(FormatTypes feedFormat)
 {
     switch (feedFormat)
     {
     case FormatTypes.XML:
     case FormatTypes.JSON:
     default:
         return(new JSONFormatter());
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the object class with the default values
 /// </summary>
 public TextNumberFormat()
 {
     this.numberFormat      = new NumberFormatInfo();
     this.numberFormatType  = TextNumberFormat.FormatTypes.General;
     this.groupingActivated = true;
     this.separator         = this.GetSeparator(TextNumberFormat.FormatTypes.General);
     this.maxIntDigits      = 127;
     this.minIntDigits      = 1;
     this.maxFractionDigits = 3;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the class with the specified number format,
 /// uses the system's culture information,
 /// and assigns the amount of fractional digits to use
 /// </summary>
 /// <param name="theType">Number format</param>
 /// <param name="cultureNumberFormat">Represents information about a specific culture including the number formatting</param>
 /// <param name="digits">Number of fractional digits to use</param>
 private TextNumberFormat(TextNumberFormat.FormatTypes theType,
                          CultureInfo cultureNumberFormat, int digits)
 {
     this.numberFormat      = cultureNumberFormat.NumberFormat;
     this.numberFormatType  = theType;
     this.groupingActivated = true;
     this.separator         = this.GetSeparator(theType);
     this.maxIntDigits      = 127;
     this.minIntDigits      = 1;
     this.maxFractionDigits = 3;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the class with the specified number format
 /// and the amount of fractional digits to use
 /// </summary>
 /// <param name="theType">Number format</param>
 /// <param name="digits">Number of fractional digits to use</param>
 private TextNumberFormat(TextNumberFormat.FormatTypes theType,
                          int digits)
 {
     this.numberFormat      = NumberFormatInfo.CurrentInfo;
     this.numberFormatType  = theType;
     this.groupingActivated = true;
     this.separator         = this.GetSeparator(theType);
     this.maxIntDigits      = 127;
     this.minIntDigits      = 1;
     this.maxFractionDigits = 3;
 }
Exemplo n.º 7
0
 public static Color GetPresetColor(FormatTypes formatType)
 {
     foreach (KeyValuePair <FormatTypes, Color> color in presetColors)
     {
         if (color.Key == formatType)
         {
             return(color.Value);
         }
     }
     return(Color.Transparent);
 }
Exemplo n.º 8
0
 public static Font GetPresetFont(FormatTypes formatType)
 {
     foreach (KeyValuePair <FormatTypes, Font> font in presetFonts)
     {
         if (font.Key == formatType)
         {
             return(font.Value);
         }
     }
     return(null);
 }
        public ResultViewerViewModel(IEzSbytServiceFunctionViewModel parent, ServiceResult data, FormatTypes formatType) : this()
        {
            if (parent == null)
            {
                throw new ArgumentNullException("Parent must be not null!");
            }
            _parent = parent;

            SelectedFormatType = formatType;
            _data = data;
            InitSource();
        }
Exemplo n.º 10
0
        private void setValidationString(String val)
        {
            //read format
            FormatTypes.Clear();
            foreach (char ch in val.ToCharArray())
            {
                if (ch.Equals('*'))
                {
                    FormatTypes.Add(CharType.AnyLetterDigit);
                }
                else if (ch.Equals('~'))
                {
                    FormatTypes.Add(CharType.Letter);
                }
                else if (ch.Equals('!'))
                {
                    FormatTypes.Add(CharType.UpperCaseLetter);
                }
                else if (ch.Equals('_'))
                {
                    FormatTypes.Add(CharType.LowerCaseLetter);
                }
                else if (ch.Equals('#'))
                {
                    FormatTypes.Add(CharType.Digit);
                }
                else if (ch.Equals('%'))
                {
                    FormatTypes.Add(CharType.Double);
                }
                else
                {
                    FormatTypes.Add(CharType.Fixed);
                }
            }
            //show completion string
            String str = "";

            for (int i = 0; i < FormatTypes.Count; i++)
            {
                CharType type = FormatTypes[i];
                if (type == CharType.Fixed)
                {
                    str += val[i];
                }
                else
                {
                    str += MaskChar;
                }
            }
            this.Text        = str;
            this.FormatTypes = FormatTypes;
        }
Exemplo n.º 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sourceColumnName">The name of the source column</param>
 /// <param name="formatString"></param>
 /// <param name="formatType">The format type to use when processing this rule</param>
 public Rule_Format(DashboardHelper dashboardHelper, string friendlyRule, string sourceColumnName, string destinationColumnName, string formatString, FormatTypes formatType)
 {
     this.friendlyRule          = friendlyRule;
     this.formatString          = formatString;
     this.sourceColumnName      = sourceColumnName;
     this.destinationColumnName = destinationColumnName;
     this.formatType            = formatType;
     this.suffix                = string.Empty;
     this.dashboardHelper       = dashboardHelper;
     this.destinationColumnType = "System.String";
     Construct();
 }
Exemplo n.º 12
0
        public string Format(FormatTypes inputType, string input)
        {
            switch (inputType)
            {
            case FormatTypes.Json:
                return(_jsonFormatter.Format(input));

            case FormatTypes.Html:
                return(_htmlFormatter.Format(input));

            default:
                throw new Exception("unsupported format type!");
            }
        }
Exemplo n.º 13
0
        // Formatlama işlemini yapan metod
        public string Format(FormatTypes inputType, string input)
        {
            switch (inputType)
            {
            case FormatTypes.Json:
                return(_jsonFormatter.Format(input));

            case FormatTypes.Html:
                return(_htmlFormatter.Format(input));

            default:
                throw new Exception("Desteklenmeyen format tipi!");
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Creates the rule from an Xml element
        /// </summary>
        /// <param name="element">The XmlElement from which to create the rule</param>
        public override void CreateFromXml(System.Xml.XmlElement element)
        {
            foreach (XmlElement child in element.ChildNodes)
            {
                if (child.Name.Equals("friendlyRule"))
                {
                    this.friendlyRule = child.InnerText;
                }
                else if (child.Name.Equals("sourceColumnName"))
                {
                    this.sourceColumnName = child.InnerText;
                }
                else if (child.Name.Equals("destinationColumnName"))
                {
                    this.destinationColumnName = child.InnerText;
                }
                else if (child.Name.Equals("destinationColumnType"))
                {
                    this.destinationColumnType = child.InnerText;
                }
                else if (child.Name.Equals("formatString"))
                {
                    this.formatString = child.InnerText;
                }
                else if (child.Name.Equals("formatType"))
                {
                    this.formatType = ((FormatTypes)Int32.Parse(child.InnerText));
                }
            }

            if (this.FormatType.Equals(FormatTypes.Hours))
            {
                this.destinationColumnType = "System.Decimal";
                this.variableType          = DashboardVariableType.Numeric;
            }
            else if (this.FormatType.Equals(FormatTypes.EpiWeek))
            {
                this.destinationColumnType = "System.Decimal";
                this.variableType          = DashboardVariableType.Numeric;
            }
            else if (destinationColumnType.Equals("System.String"))
            {
                this.variableType = DashboardVariableType.Text;
            }
            else if (destinationColumnType.Equals("System.Single") || destinationColumnType.Equals("System.Double") || destinationColumnType.Equals("System.Decimal") || destinationColumnType.Equals("System.Int16") || destinationColumnType.Equals("System.Int32"))
            {
                this.variableType = DashboardVariableType.Numeric;
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Ctor
        /// </summary>
        /// <param name="start">start position</param>
        /// <param name="length">length</param>
        /// <param name="record">record line</param>
        /// <param name="format">format</param>
        public void Parse(string record, int start = -1, int length = -1, FormatTypes format = FormatTypes.None)
        {
            string value      = string.Empty;
            var    lineLength = start + length;

            this._Start  = start;
            this._Length = length;

            //get the value from the record
            if (!string.IsNullOrEmpty(record))
            {
                //If start position and length is -1 then no need to get value, just need to apply formatting
                if (start == -1 && length == -1)
                {
                    value = record;
                }
                else
                {
                    if (record.Length >= lineLength)
                    {
                        value = record.Substring(this.Start, this.Length);
                    }
                }
            }
            ///Format according to format type provided
            switch (format)
            {
            //date format
            case FormatTypes.DateFormat:
                value = Utility.FormatDate(value);
                break;

            //remove prefix zeros
            case FormatTypes.RemovePrefixZeros:
                value = Utility.ReplacePrefixZeros(value);
                break;

            //Do nothing
            case FormatTypes.None:
            default:
                //Do nothing
                break;
            }
            this._Value = value.Trim();
        }
Exemplo n.º 16
0
        // ////////////////////////////////////////////////////////////////////////////


        //IsFormat => cette méthode fonctionne comme un filtre qui nous renseigne sur les ensembles de valeurs d'énumération (elle contient une instruction switch).
        //Renvoie vrai si le FormatType est Gras ou Italique.
        static bool IsFormat(FormatTypes value)
        {
            switch (value)
            {
            case FormatTypes.BoldFormat:
            case FormatTypes.ItalicsFormat:
            {
                // Ces 2 valeurs sont des valeurs de format.
                return(true);
            }

            default:
            {
                // L'argument n'est pas une valeur de format.
                return(false);
            }
            }
        }
Exemplo n.º 17
0
        /// <summary>
        /// 格式化
        /// </summary>
        /// <param name="formatType"></param>
        /// <param name="value"></param>
        /// <returns></returns>
        private static string Format(FormatTypes formatType, object value)
        {
            switch (formatType)
            {
            case FormatTypes.Percent:
                return(((decimal)value).ToString("P"));

            case FormatTypes.Date:
                return(value == null ? string.Empty : (Convert.ToDateTime(value)).ToString("yyyy-MM-dd"));

            case FormatTypes.DateTime:
                return(value == null ? string.Empty : (Convert.ToDateTime(value)).ToString("yyyy-MM-dd HH:mm:ss"));

            case FormatTypes.None:
            default:
                return(value == null ? string.Empty : value.ToString());
            }
        }
Exemplo n.º 18
0
        private string FormatValue(object i_value, FormatTypes i_Type)
        {
            switch (i_Type)
            {
            case FormatTypes.Decimal:
                return(string.Format("{0:0.00}", i_value));

            case FormatTypes.Int:
                return(string.Format("{0:0}", i_value));

            case FormatTypes.Precent:
                return(string.Format("{0:0%}", i_value));

            case FormatTypes.String:
            default:
                return(i_value.ToString());
            }
        }
Exemplo n.º 19
0
        /// <summary>
        /// Handles the SelectionChanged Event for cbxFormatOptions.
        /// Code for EpiWeek is commented as being out of scope.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void cbxFormatOptions_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (cbxFormatOptions.SelectedIndex >= 0)
            {
                FormatTypes type = GetFormatType();

                if (type != FormatTypes.EpiWeek)
                {
                    //EwavRule_Format tempFormatRule = new EwavRule_Format();//dashboardHelper, "temp", "temp", "temp", "temp", type);
                    string formatString = GetFormatString(type);
                    txtPreview.Text = string.Format(System.Globalization.CultureInfo.CurrentCulture, formatString, DateTime.Now);
                }
                else
                {
                    //StatisticsRepository.EpiWeek epiWeek = new StatisticsRepository.EpiWeek();
                    txtPreview.Text = GetEpiWeek(DateTime.Now).ToString().Trim();
                }
            }
        }
Exemplo n.º 20
0
        public ChatControl()
        {
            InitializeComponent();
            InitUI();

            rtbMessage.ContextMenu       = mnuMessageBox;
            rtbMessage.AllowDrop         = true;
            rtbMessage.DragEnter        += new DragEventHandler(TextBox_DragEnter);
            rtbMessage.DragDrop         += new DragEventHandler(TextBox_DragDrop);
            rtbMessageHistory.AllowDrop  = true;
            rtbMessageHistory.DragEnter += new DragEventHandler(TextBox_DragEnter);
            rtbMessageHistory.DragDrop  += new DragEventHandler(TextBox_DragDrop);

            fontList       = new List <string>();
            colorList      = new List <string>();
            bEnabled       = true;
            bWindowed      = false;
            bCanSave       = false;
            lastTypeTime   = DateTime.MinValue;
            lastFormatType = FormatTypes.Default;
        }
        public static dynamic GetTSObject(FormatTypes dynEnum)
        {
            var tsType = TSActivator.CreateInstance("Tekla.Structures.Drawing.FormatTypes").GetType();

            switch (dynEnum)
            {
            case FormatTypes.Automatic:
                return(System.Enum.Parse(tsType, "Automatic"));

            case FormatTypes.WholeNumber:
                return(System.Enum.Parse(tsType, "WholeNumber"));

            case FormatTypes.OneDecimalIfValidDecimal:
                return(System.Enum.Parse(tsType, "OneDecimalIfValidDecimal"));

            case FormatTypes.OneDecimal:
                return(System.Enum.Parse(tsType, "OneDecimal"));

            case FormatTypes.TwoDecimalsIfValidDecimals:
                return(System.Enum.Parse(tsType, "TwoDecimalsIfValidDecimals"));

            case FormatTypes.TwoDecimals:
                return(System.Enum.Parse(tsType, "TwoDecimals"));

            case FormatTypes.ThreeDecimalsIfValidDecimals:
                return(System.Enum.Parse(tsType, "ThreeDecimalsIfValidDecimals"));

            case FormatTypes.ThreeDecimals:
                return(System.Enum.Parse(tsType, "ThreeDecimals"));

            case FormatTypes.Fractional:
                return(System.Enum.Parse(tsType, "Fractional"));

            default:
                throw new DynamicAPIException(dynEnum.ToString() + "- enum value is not implemented");
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// Retrieves the separator used, depending on the format type specified
        /// </summary>
        /// <param name="numberFormatType">formatType enumarator value to inquire</param>
        /// <returns>The values of character separator used </returns>
        private string GetSeparator(FormatTypes numberFormatType)
        {
            string separatorItem = " ";              //Default Separator

            switch (numberFormatType)
            {
            case TextNumberFormat.FormatTypes.Currency:
                separatorItem = this.numberFormat.CurrencyGroupSeparator;
                break;

            case TextNumberFormat.FormatTypes.General:
                separatorItem = this.numberFormat.NumberGroupSeparator;
                break;

            case TextNumberFormat.FormatTypes.Number:
                separatorItem = this.numberFormat.NumberGroupSeparator;
                break;

            case TextNumberFormat.FormatTypes.Percent:
                separatorItem = this.numberFormat.PercentGroupSeparator;
                break;
            }
            return(separatorItem);
        }
Exemplo n.º 23
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sourceColumnName">The name of the source column</param>
 /// <param name="formatString"></param>
 /// <param name="formatType">The format type to use when processing this rule</param>
 public Rule_Format(DashboardHelper dashboardHelper, string friendlyRule, string sourceColumnName, string destinationColumnName, string formatString, FormatTypes formatType)
 {
     this.friendlyRule = friendlyRule;
     this.formatString = formatString;
     this.sourceColumnName = sourceColumnName;
     this.destinationColumnName = destinationColumnName;
     this.formatType = formatType;
     this.suffix = string.Empty;
     this.dashboardHelper = dashboardHelper;
     this.destinationColumnType = "System.String";
     Construct();
 }
Exemplo n.º 24
0
        /// <summary>
        /// Creates the rule from an Xml element
        /// </summary>
        /// <param name="element">The XmlElement from which to create the rule</param>
        public override void CreateFromXml(System.Xml.XmlElement element)
        {
            foreach (XmlElement child in element.ChildNodes)
            {
                if (child.Name.Equals("friendlyRule"))
                {
                    this.friendlyRule = child.InnerText;
                }
                else if (child.Name.Equals("sourceColumnName"))
                {
                    this.sourceColumnName = child.InnerText;
                }
                else if (child.Name.Equals("destinationColumnName"))
                {
                    this.destinationColumnName = child.InnerText;
                }
                else if (child.Name.Equals("destinationColumnType"))
                {
                    this.destinationColumnType = child.InnerText;
                }
                else if (child.Name.Equals("formatString"))
                {
                    this.formatString = child.InnerText;
                }
                else if (child.Name.Equals("formatType"))
                {
                    this.formatType = ((FormatTypes)Int32.Parse(child.InnerText));
                }
            }

            if (this.FormatType.Equals(FormatTypes.Hours))
            {
                this.destinationColumnType = "System.Decimal";
                this.variableType = DashboardVariableType.Numeric;
            }
            else if (this.FormatType.Equals(FormatTypes.EpiWeek))
            {
                this.destinationColumnType = "System.Decimal";
                this.variableType = DashboardVariableType.Numeric;
            }
            else if (destinationColumnType.Equals("System.String"))
            {
                this.variableType = DashboardVariableType.Text;
            }
            else if (destinationColumnType.Equals("System.Single") || destinationColumnType.Equals("System.Double") || destinationColumnType.Equals("System.Decimal") || destinationColumnType.Equals("System.Int16") || destinationColumnType.Equals("System.Int32"))
            {
                this.variableType = DashboardVariableType.Numeric;
            }
        }
Exemplo n.º 25
0
        /// <summary>
        /// Gets the format string for this rule
        /// </summary>
        public string GetFormatString(FormatTypes type)
        {
            string formatString = string.Empty;

            switch (type)
            {
            case FormatTypes.EpiWeek:
                formatString = "epiweek";     // note: Special case scenario
                break;

            case FormatTypes.Day:
                formatString = "{0:dd}";
                break;

            case FormatTypes.ShortDayName:
                formatString = "{0:ddd}";
                break;

            case FormatTypes.FullDayName:
                formatString = "{0:dddd}";
                break;

            case FormatTypes.FourDigitYear:
                formatString = "{0:yyyy}";
                break;

            case FormatTypes.TwoDigitYear:
                formatString = "{0:yy}";
                break;

            case FormatTypes.DayMonth:
                formatString = "{0:M}";
                break;

            case FormatTypes.Month:
                formatString = "{0:MM}";
                break;

            case FormatTypes.ShortMonthName:
                formatString = "{0:MMM}";
                break;

            case FormatTypes.FullMonthName:
                formatString = "{0:MMMM}";
                break;

            case FormatTypes.RFC1123:
                formatString = "{0:r}";
                break;

            case FormatTypes.RegularDate:
                formatString = "{0:d}";
                break;

            case FormatTypes.LongDate:
                formatString = "{0:D}";
                break;

            case FormatTypes.SortableDateTime:
                formatString = "{0:s}";
                break;

            case FormatTypes.MonthYear:
                formatString = "{0:y}";
                break;

            case FormatTypes.Hours:
                formatString = "{0:HH}";
                break;

            case FormatTypes.HoursMinutes:
                formatString = "{0:t}";
                break;

            case FormatTypes.HoursMinutesSeconds:
                formatString = "{0:T}";
                break;

            case FormatTypes.NumericInteger:
                formatString = "{0:0}";
                break;

            case FormatTypes.NumericDecimal1:
                formatString = "{0:0.0}";
                break;

            case FormatTypes.NumericDecimal2:
                formatString = "{0:0.00}";
                break;

            case FormatTypes.NumericDecimal3:
                formatString = "{0:0.000}";
                break;

            case FormatTypes.NumericDecimal4:
                formatString = "{0:0.0000}";
                break;

            case FormatTypes.NumericDecimal5:
                formatString = "{0:0.00000}";
                break;

            case FormatTypes.MonthAndFourDigitYear:
                formatString = "{0:y}";
                break;
            }

            return(formatString);
        }
Exemplo n.º 26
0
        /// <summary>
        /// Gets the appropriate FormatType based on the selected format option
        /// </summary>
        /// <returns>FormatType</returns>
        private FormatTypes GetFormatType()
        {
            #region Input Validation
            if (cbxFormatOptions.SelectedItem == null)
            {
                //throw new ApplicationException("No value selected for the format option.");
            }
            #endregion // Input Validation

            FormatTypes formatType = FormatTypes.Day;

            string option = cbxFormatOptions.SelectedItem.ToString();

            switch (option)
            {
            case "an integer":
                formatType = FormatTypes.NumericInteger;
                break;

            case "a decimal with one digit":
                formatType = FormatTypes.NumericDecimal1;
                break;

            case "a decimal with two digits":
                formatType = FormatTypes.NumericDecimal2;
                break;

            case "a decimal with three digits":
                formatType = FormatTypes.NumericDecimal3;
                break;

            case "a decimal with four digits":
                formatType = FormatTypes.NumericDecimal4;
                break;

            case "a decimal with five digits":
                formatType = FormatTypes.NumericDecimal5;
                break;

            case "the day":
                formatType = FormatTypes.Day;
                break;

            case "the day name":
                formatType = FormatTypes.FullDayName;
                break;

            case "the abbreviated day name":
                formatType = FormatTypes.ShortDayName;
                break;

            case "the month":
                formatType = FormatTypes.Month;
                break;

            case "the month and four-digit year":
                formatType = FormatTypes.MonthAndFourDigitYear;
                break;

            case "the month name":
                formatType = FormatTypes.FullMonthName;
                break;

            case "the abbreviated month name":
                formatType = FormatTypes.ShortMonthName;
                break;

            case "the standard date":
                formatType = FormatTypes.RegularDate;
                break;

            case "the long date":
                formatType = FormatTypes.LongDate;
                break;

            case "the epi week":
                formatType = FormatTypes.EpiWeek;
                break;

            case "the four-digit year":
                formatType = FormatTypes.FourDigitYear;
                break;

            case "the two-digit year":
                formatType = FormatTypes.TwoDigitYear;
                break;

            case "the RFC 1123 date":
                formatType = FormatTypes.RFC1123;
                break;

            case "the sortable date":
                formatType = FormatTypes.SortableDateTime;
                break;

            case "the hour":
                formatType = FormatTypes.Hours;
                break;
            }

            return(formatType);
        }
Exemplo n.º 27
0
 public PropertyFormatAttribute(FormatTypes type)
 {
     this.Type = type;
 }
Exemplo n.º 28
0
        public string ParseWithFormat(FormatTypes formatType)
        {
            var formatter = FeedFormatterFactory.GetFormatter(formatType);

            throw new System.NotImplementedException();
        }
Exemplo n.º 29
0
        static void Main(string[] args)
        {
            //***** Exemple 1 *****
            // Spécifiez une instance de balise.
            ColorTypes tagValue = ColorTypes.Rouge;



            if (tagValue == ColorTypes.Rouge)
            {
                // Sera afficher.
                Console.WriteLine("Rouge");
            }
            else
            {
                // Ne Sera pas afficher.
                Console.WriteLine("Pas Vrai");
            }
            Console.WriteLine();
            //Affiche :
            //Rouge


            //***** Exemple 2 *****
            //Console.WriteLine peut appeler automatiquement la méthode ToString.

            // ... Deux variables enum.
            ColorTypes      color   = ColorTypes.Bleu;
            VisibilityTypes visible = VisibilityTypes.Hidden;

            // ... Utilisez Console.WriteLine pour imprimer les valeurs d'héritier.
            Console.WriteLine(color);
            Console.WriteLine(visible);
            Console.WriteLine();



            //***** Exemple 3 *****
            // ... Test enum avec la méthode switch.
            FormatTypes formatValue = FormatTypes.None;

            if (IsFormat(formatValue))
            {
                // Ceci n'est pas atteint, car None ne renvoie pas une vraie valeur dans IsFormat.
                Console.WriteLine("Error");
            }
            // ... Testez une autre énumération avec switch.
            formatValue = FormatTypes.ItalicsFormat;
            if (IsFormat(formatValue))
            {
                // Ceci est imprimé, car nous recevons true de IsFormat.
                Console.WriteLine("True");
            }
            Console.WriteLine();
            //Affiche :
            //True


            //***********************************************************


            // ***** recupere un Char defini dans l'enum *****
            CharTypes charEnum = CharTypes.AnoniemNIETActive;

            Console.WriteLine("{0}: {1}", (char)charEnum, charEnum);
            Console.WriteLine();
            //Affiche :
            //R : AnoniemNIETActive


            // ***** recupere un string defini dans l'enum *****
            ColorTypes colorType = ColorTypes.Bleu;

            Console.WriteLine(colorType);
            Console.WriteLine("string : " + colorType + ", " + "Valeur : " + (int)colorType);
            Console.WriteLine();
            //Affiche :
            //Bleu
            //string : Bleu, Valeur :  33

            //ou

            foreach (var item in Enum.GetNames(typeof(ColorTypes)).ToList())
            {
                Console.WriteLine(item);
            }
            Console.WriteLine();
            //Affiche :
            //Rouge
            //Vert
            //Bleu


            // ***** recupere les valeurs defini dans l'enum *****
            foreach (int item in Enum.GetValues(typeof(ColorTypes)))
            {
                Console.WriteLine(item);
            }
            Console.WriteLine();
            //Affiche :
            //0
            //1
            //2
            //33
            foreach (int item in Enum.GetValues(typeof(CharTypes)))
            {
                Console.WriteLine(item);
            }
            Console.WriteLine();
            //Affiche :
            //32
            //65
            //82
            //87
            //90



            Console.WriteLine((char)(int)CharTypes.Archive);
            Console.WriteLine((char)CharTypes.AnoniemActive);
            Console.WriteLine(CharTypes.AnoniemActive);
        }
Exemplo n.º 30
0
 private void SetCellValueWithClickEvent(int i_Row, int i_Col, object i_Value, FormatTypes i_Type, Int32Collection i_Rows)
 {
     if (i_Value != null)
     {
         DataSet m_DBSet = this.ExControl.DataSource as DataSet;
         Webb.Reports.DataProvider.VideoPlayBackArgs m_args = new Webb.Reports.DataProvider.VideoPlayBackArgs(m_DBSet, i_Rows);
         (this.PrintingTable.GetCell(i_Row, i_Col) as WebbTableCell).ClickEventArg = m_args;
         this.PrintingTable.GetCell(i_Row, i_Col).Text = this.FormatValue(i_Value, i_Type);
     }
 }
Exemplo n.º 31
0
 public PropertyFormatAttribute(FormatTypes type)
 {
     this.Type = type;
 }
Exemplo n.º 32
0
        public RText(string record, IEnumerable <RecordMapping> mapping, string propName, FormatTypes format = FormatTypes.None)
        {
            int start  = 0;
            int length = 0;

            if (mapping != null)
            {
                foreach (var item in mapping)
                {
                    if (item.Field.ToLower().Equals(propName))
                    {
                        _Offset = Convert.ToInt32(item.Start);
                        start   = Convert.ToInt32(item.Start) - 1;
                        length  = Convert.ToInt32(item.Length);
                        break;
                    }
                }
            }
            Parse(record, start, length, format);
        }
Exemplo n.º 33
0
 public StringFormat GetStringFormat(FormatTypes type)
 {
     return(shared_formats[(int)type]);
 }
Exemplo n.º 34
0
 public StringFormat GetStringFormat( FormatTypes type )
 {
     return shared_formats[(int)type];
 }