Ejemplo n.º 1
0
 public void ConstructWithParametersHeadingContentTest()
 {
     this.heading = "Value of heading";
     this.content = "Value of content";
     this.testObject = new HeadingPresenter(this.heading, this.content);
     this.testObject = new HeadingPresenter(null, this.content);
     this.testObject = new HeadingPresenter(this.heading, null);
     this.testObject = new HeadingPresenter(null, null);
 }
Ejemplo n.º 2
0
 public void ConstructWithParametersHeadingContentTest()
 {
     this.heading    = "Value of heading";
     this.content    = "Value of content";
     this.testObject = new HeadingPresenter(this.heading, this.content);
     this.testObject = new HeadingPresenter(null, this.content);
     this.testObject = new HeadingPresenter(this.heading, null);
     this.testObject = new HeadingPresenter(null, null);
 }
Ejemplo n.º 3
0
 public void TearDown()
 {
     this.testObject = null;
 }
Ejemplo n.º 4
0
 public void SetUp()
 {
     this.heading = "Value of heading";
     this.content = "Value of content";
     this.testObject = new HeadingPresenter(this.heading, this.content);
 }
Ejemplo n.º 5
0
 public void TearDown()
 {
     this.testObject = null;
 }
Ejemplo n.º 6
0
 public void SetUp()
 {
     this.heading    = "Value of heading";
     this.content    = "Value of content";
     this.testObject = new HeadingPresenter(this.heading, this.content);
 }
Ejemplo n.º 7
0
 private static T Dump <T>(this T o, string description, int?depth, bool toDataGrid, Action <ClickContext> onClick)
 {
     if (o != null)
     {
         Type type = o.GetType();
         if ((((!type.IsValueType && !type.IsPrimitive) && (type.Namespace != null)) && (type.Namespace.StartsWith("System.Threading.Tasks.Dataflow") && (type.GetInterface("System.Threading.Tasks.Dataflow.IDataflowBlock") != null))) && DataflowBridge.Dump(o, description))
         {
             return(o);
         }
     }
     if (depth < 0)
     {
         depth = null;
     }
     if (depth > 20)
     {
         depth = 20;
     }
     if (((depth.HasValue || toDataGrid) || !AppDomain.CurrentDomain.GetAssemblies().Any <Assembly>(a => a.FullName.StartsWith("PresentationCore,", StringComparison.InvariantCultureIgnoreCase))) || !WpfBridge.DumpWpfElement(o, description))
     {
         bool flag2;
         if ((!depth.HasValue && !toDataGrid) && (o is Control))
         {
             if (o is Form)
             {
                 ((Form)o).Show();
                 return(o);
             }
             PanelManager.DisplayControl((Control)o, description ?? "WinForms");
             return(o);
         }
         if ((o is XContainer) || (o is XmlDocument))
         {
             PanelManager.DisplaySyntaxColoredText(o.ToString(), SyntaxLanguageStyle.XML, description ?? "XML");
             return(o);
         }
         Server     currentServer = Server.CurrentServer;
         TextWriter writer        = (currentServer == null) ? null : currentServer.LambdaFormatter;
         Expression expr          = null;
         if (writer != null)
         {
             if (o is IQueryable)
             {
                 expr = ((IQueryable)o).Expression;
             }
             else if (o is Expression)
             {
                 expr = (Expression)o;
             }
         }
         if (expr != null)
         {
             string content = "";
             try
             {
                 ExpressionToken token = ExpressionToken.Visit(expr);
                 if (token != null)
                 {
                     content = token.ToString();
                 }
             }
             catch (Exception exception)
             {
                 Log.Write(exception, "Dump ExpressionToken Visit");
             }
             if (content.Length > 0)
             {
                 lock (writer)
                 {
                     if (!string.IsNullOrEmpty(description))
                     {
                         writer.WriteLine(new HeadingPresenter(description, content));
                     }
                     else
                     {
                         writer.WriteLine(content + "\r\n");
                     }
                 }
             }
         }
         if ((currentServer != null) && currentServer.WriteResultsToGrids)
         {
             toDataGrid = true;
         }
         if (toDataGrid && (o != null))
         {
             Type t = o.GetType();
             if (((!ExplorerGrid.IsAtomic(t) && (!t.IsArray || (t.GetArrayRank() == 1))) && (t.GetInterface("System.IObservable`1") == null)) && (t.GetCustomAttributes(typeof(MetaGraphNodeAttribute), false).Length == 0))
             {
                 return(o.Explore <T>(description));
             }
         }
         XhtmlWriter writer3 = (currentServer == null) ? null : currentServer.ResultsWriter;
         if (flag2 = o is Type)
         {
             ObjectNode.ExpandTypes = true;
         }
         try
         {
             if (!string.IsNullOrEmpty(description))
             {
                 HeadingPresenter presenter = new HeadingPresenter(description, o);
                 if (writer3 != null)
                 {
                     writer3.WriteDepth(presenter, depth, onClick);
                 }
                 else
                 {
                     Console.Write(presenter);
                 }
                 return(o);
             }
             if (writer3 != null)
             {
                 writer3.WriteLineDepth(o, depth, onClick);
             }
             else
             {
                 Console.WriteLine(o);
             }
         }
         finally
         {
             if (flag2)
             {
                 ObjectNode.ExpandTypes = false;
             }
         }
     }
     return(o);
 }