public static List <CloudotLogFileView> GetFromXML(string fileName = @"E:\tmp\CloudotLog.xml")
        {
            var result = new List <CloudotLogFileView>();

            try
            {
                var data = XElement.Load(fileName);

                foreach (var e in data.Elements())
                {
                    var cmdLine = new List <string>();
                    foreach (var attr in e.Elements())
                    {
                        cmdLine.Add(attr.Value);
                    }

                    result.Add(new CloudotLogFileView(e.Attribute("What").Value, e.Attribute("When").Value)
                    {
                        CommandLine = CloudotLogFileView.CmdLine2String(cmdLine)
                    });
                }
            }
            catch (Exception)
            {
                result = null;
            }
            return(result);
        }
Exemple #2
0
        private void InitializeDataStructures()
        {
            this.TextBoxForCloudotServiceAddress.Text = "net.tcp://cloudotserver:9922/ClousotService/";
            //  "<FlowDocument><Paragraph>This is a richTextBox. And this is a <Hyperlink NavigateUri=\"http://www.microsoft.com\">Hyperlink</Hyperlink>.</Paragraph></FlowDocument>";

            /*
             * var para = new Paragraph();
             * para.Inlines.Add(new Run("Sito web di MSR "));
             * para.Inlines.Add(new Hyperlink(new Run("http://research.microsoft.com")));
             * this.TextBoxForLogging.Document = new FlowDocument(para);
             *
             * para = new Paragraph();
             * para.Inlines.Add(new Run("Sito web di MSR 2"));
             * para.Inlines.Add(new Hyperlink(new Run("http://research.microsoft.com/~logozzo")));
             *
             * this.TextBoxForLogging.Document.Blocks.Add(para);
             */

            // F: I do not understand why C# does not allow me a lambda here
            this.Dispatcher.BeginInvoke((initUI) delegate()
            {
                var data = CloudotLogFileView.GetFromXML();
                this.AnalysesDataGrid.ItemsSource = data;
                this.LabelForAnalyses.Content     = string.Format("Analyses {0}({1} entries)", Environment.NewLine, this.AnalysesDataGrid.Items.Count);
            }
                                        );
        }
Exemple #3
0
        private void AnalyzeSelectedItem(CloudotLogFileView entry)
        {
            if (entry == null)
            {
                return;
            }
            this.AddLineToLog("Request the analysis of {0} to Cloudot", entry.Assembly);

            CloudotInteraction.FireAnalysisAndForget(TextBoxForCloudotServiceAddress.Text,
                                                     entry.Assembly, CloudotLogFileView.String2CmdLine(entry.CommandLine), AddLineToLog);
        }
    private void AnalyzeSelectedItem(CloudotLogFileView entry)
    {
      if (entry == null)
      {
        return;
      }
      this.AddLineToLog("Request the analysis of {0} to Cloudot", entry.Assembly);

      CloudotInteraction.FireAnalysisAndForget(TextBoxForCloudotServiceAddress.Text,
        entry.Assembly, CloudotLogFileView.String2CmdLine(entry.CommandLine), AddLineToLog);
    }