示例#1
0
 internal static ObjectElement CreateObject(TranslatableElement fieldName, string className)
 {
     return(new ObjectElement {
         Type = Types.Object,
         Name = fieldName,
         ClassName = className
     });
 }
示例#2
0
        internal ObjectElement ExploreObject(TranslatableElement fieldName, object obj)
        {
            // Create the element then replace its Name
            var element = ExploreObject("", obj);

            element.Name = fieldName;
            return(element);
        }
示例#3
0
 internal static ObjectElement CreateField(TranslatableElement fieldName, string className, object value)
 {
     return(new ObjectElement {
         Type = Types.Field,
         Name = fieldName,
         ClassName = className,
         Value = value
     });
 }
示例#4
0
 internal static ObjectElement CreateException(TranslatableElement message, string className, string[] stackTrace)
 {
     System.Diagnostics.Debug.Assert(stackTrace != null, "Argument 'stackTrace' is not specified");
     return(new ObjectElement {
         Type = Types.Exception,
         StackTrace = stackTrace,
         Value = message,
         ClassName = className
     });
 }
示例#5
0
 public SerializableTranslatable(TranslatableElement translatable)
 {
     Key = translatable.TextKey;
     if (translatable.Parameters != null)
     {
         Parameters = new SerializablePrimitive[translatable.Parameters.Length];
         for (int i = 0; i < Parameters.Length; ++i)
         {
             Parameters[i] = new SerializablePrimitive(translatable.Parameters[i]);
         }
     }
 }
示例#6
0
        public Manager AddData(TranslatableElement key, object value)
        {
            System.Diagnostics.Debug.Assert(Tree != null, "The property 'Tree' is not supposed to be null");

            // Insert a new field right before the exception list
            var explorer = new ObjectExplorer();
            var element  = explorer.ExploreObject(key, value);

            Tree.Children.Insert(GetFirstExceptionIndex(), element);

            return(this);
        }
示例#7
0
            public TranslatableElement CreateTranslatableElement()
            {
                var translatable = new TranslatableElement {
                    TextKey = Key
                };

                if (Parameters != null)
                {
                    var parameters = new object[Parameters.Length];
                    for (int i = 0; i < Parameters.Length; ++i)
                    {
                        parameters[i] = Parameters[i].Value;
                    }
                    translatable.Parameters = parameters;
                }
                return(translatable);
            }
示例#8
0
 public TranslatableElement CreateTranslatableElement()
 {
     var translatable = new TranslatableElement{ TextKey = Key };
     if( Parameters != null )
     {
         var parameters = new object[ Parameters.Length ];
         for( int i=0; i<Parameters.Length; ++i )
             parameters[ i ] = Parameters[ i ].Value;
         translatable.Parameters = parameters;
     }
     return translatable;
 }
示例#9
0
 public SerializableTranslatable(TranslatableElement translatable)
 {
     Key = translatable.TextKey;
     if( translatable.Parameters != null )
     {
         Parameters = new SerializablePrimitive[ translatable.Parameters.Length ];
         for( int i=0; i<Parameters.Length; ++i )
             Parameters[ i ] = new SerializablePrimitive( translatable.Parameters[i] );
     }
 }
示例#10
0
 internal ObjectElement ExploreObject(TranslatableElement fieldName, object obj)
 {
     // Create the element then replace its Name
     var element = ExploreObject( "", obj );
     element.Name = fieldName;
     return element;
 }
示例#11
0
 public BaseException(TranslatableElement message)
     : base(message.TextKey)
 {
     Init( message );
 }
示例#12
0
 internal static ObjectElement CreateField(TranslatableElement fieldName, string className, object value)
 {
     return new ObjectElement {
         Type = Types.Field,
         Name = fieldName,
         ClassName = className,
         Value = value };
 }
示例#13
0
 public BaseException(TranslatableElement message) : base(message.TextKey)
 {
     Init(message);
 }
示例#14
0
 public BaseException(TranslatableElement message, Exception innerException)
     : base(message.TextKey, innerException)
 {
     Init( message );
 }
示例#15
0
 public BaseException(TranslatableElement message, Exception innerException) : base(message.TextKey, innerException)
 {
     Init(message);
 }
示例#16
0
 internal static ObjectElement CreateException(TranslatableElement message, string className, string[] stackTrace)
 {
     System.Diagnostics.Debug.Assert( stackTrace != null, "Argument 'stackTrace' is not specified" );
     return new ObjectElement {
         Type = Types.Exception,
         StackTrace = stackTrace,
         Value = message,
         ClassName = className };
 }
示例#17
0
 private void Init(TranslatableElement message)
 {
     ObjectData          = new Dictionary <string, object>();
     TranslatableMessage = message;
 }
示例#18
0
 internal static ObjectElement CreateObject(TranslatableElement fieldName, string className)
 {
     return new ObjectElement {
         Type = Types.Object,
         Name = fieldName,
         ClassName = className };
 }
示例#19
0
 private void Init(TranslatableElement message)
 {
     ObjectData = new Dictionary<string,object>();
     TranslatableMessage = message;
 }