Ejemplo n.º 1
0
        public static List <ObjectInitialization> GetClassProperties(string variableName)
        {
            var classProperties = new List <ObjectInitialization>();

            var type = DebuggerHelper.GetValue(ExpressionsHelper.TypeFullName(variableName)).Replace("\"", String.Empty).Replace("+", ".");

            ////Need to cast it to specific type when enumeration contains abstract types
            foreach (string propertyName in DebuggerHelper.GetMembersName(ExpressionsHelper.Cast(variableName, type)))
            {
                if (IsPropertyInitializable(variableName, propertyName))
                {
                    var propertyInitialization = ObjectInitializationFactory.CreateObjectInitialization(String.Concat(variableName, ".", propertyName));

                    if (propertyInitialization != null)
                    {
                        classProperties.Add(propertyInitialization);
                    }
                }
            }

            return(classProperties);
        }
Ejemplo n.º 2
0
 private static bool IsDatetime(string variableName)
 {
     //pourrait être plus précis
     return(DebuggerHelper.GetValue(ExpressionsHelper.TypeFullName(variableName)).Contains("DateTime"));
 }
Ejemplo n.º 3
0
 private static bool IsString(string variableName)
 {
     return("\"System.String\"" == DebuggerHelper.GetValue(ExpressionsHelper.TypeFullName(variableName)));
 }