public void CreateDataGrid(ResultCollections collections)
        {
            Collection = collections;
            this.ResultGrid.Columns.Clear();

            for (var x = 0; x < Collection.propertyNames.Count; x++)
            {
                this.ResultGrid.Columns.Add(
                        new DataGridTextColumn
                        {
                            Header = Collection.propertyNames[x],
                            Binding = new Binding(Collection.propertyNames[x])
                        });
            }

            this.ResultGrid.ItemsSource = GenerateData().ToDataSource();
        }
        private ResultCollections ReadResultElement(XmlReader reader)
        {
            ResultCollections _RCollection = new ResultCollections();
            ResultSet currSet = null;
            
            while (reader.Read())
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        {
                            switch (reader.Name)
                            {
                                case "Item":
                                    {
                                        currSet = new ResultSet();
                                        break;
                                    }
                                case "Property":
                                    {
                                        string propName = ReadAttrValue("name", reader);
                                        if ((propName != null) && (!propertiesName.Contains(propName)))
                                            propertiesName.Add(propName);

                                        reader.Read();

                                        if (reader.Value != null && reader.Value != "")
                                        {
                                            string propValue = reader.Value;

                                            //Temp solution; tricate the value if its too long
                                            if (propValue.Length > 60)
                                                propValue = propValue.Substring(0, 59);

                                            if (propValue != null)
                                            {
                                                currSet.dataValues.Add(propValue);
                                            }
                                        }
                                        break;
                                    }
                            }
                            break;
                        }

                    case XmlNodeType.EndElement:
                        {
                            switch (reader.Name)
                            {
                                case "Item":
                                    {
                                        _RCollection.resultCollection.Add(currSet);
                                        break;
                                    }
                            }
                            break;
                        }
                }
            }

            foreach (ResultSet r in _RCollection.resultCollection)
            {
                foreach (string value in r.dataValues)
                    System.Diagnostics.Debug.WriteLine("value is! >" + value);
            }

            _RCollection.propertyNames = propertiesName;
            return _RCollection;
        }
        private void FishEyeMenu_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            ResultCollections collections = new ResultCollections();

            collections.resultCollection = new ObservableCollection<ResultSet>();



            ObservableCollection<string> propertiesName = new ObservableCollection<string>();

            propertiesName.Add("HitStart");
            propertiesName.Add("HitEnd");
            propertiesName.Add("HitCharacters");
            propertiesName.Add("HitLength");
            propertiesName.Add("HitSimilarity");

            collections.propertyNames = propertiesName ;

            ResultSet r = new ResultSet();
            ResultSet r2 = new ResultSet();
            ResultSet r3 = new ResultSet();

            r.dataValues = new ObservableCollection<string>();
            r2.dataValues = new ObservableCollection<string>();
            r3.dataValues = new ObservableCollection<string>();


            string value1 = "1";
            string value2 = "3";
            string value3 = "tcg";
            string value4 = "3";
            string value5 = "1.0";

            r.dataValues.Add(value1);
            r.dataValues.Add(value2);
            r.dataValues.Add(value3);
            r.dataValues.Add(value4);
            r.dataValues.Add(value5);

            string value6 = "2";
            string value7 = "4";
            string value8 = "tta";
            string value9 = "2";
            string value10 = "0.5";

            r2.dataValues.Add(value6);
            r2.dataValues.Add(value7);
            r2.dataValues.Add(value8);
            r2.dataValues.Add( value9);
            r2.dataValues.Add(value10);
            

            string value11 = "45";
            string value12 = "55";
            string value13 = "tttggaac";
            string value14 = "10";
            string value15 = "0.8";

            r3.dataValues.Add(value11);
            r3.dataValues.Add(value12);
            r3.dataValues.Add(value13);
            r3.dataValues.Add(value14);
            r3.dataValues.Add(value15);

            collections.resultCollection.Add(r);
            collections.resultCollection.Add(r2);
            collections.resultCollection.Add(r3);


            OnHideResultPanel(new ResultSetEventArgs(collections));
            ///Testing purpose
           /* ActivityModel model = new ActivityModel()
            {
                 ActivityClass = "Demo Class",
                 Description = "Here descripts the class",
                 //Id = new Guid("SimpleId"),
                 DisplayLabel = "MBF Library",
            };

            List<ParamterModel> inputParameters = new List<ParamterModel>();
            List<ParamterModel> outputParameters = new List<ParamterModel>();

            inputParameters.Add(new ParamterModel()
                {
                    DataType = "System.String",
                    Description = "The alphabets",
                    IsInputParam = true,
                    Label = "the label",
                    Name = "The MBF Param 1"
                }
             );

            inputParameters.Add(new ParamterModel()
            {
                DataType = "System.bool",
                Description = "True or false",
                IsInputParam = true,
                Label = "the boolean",
                Name = "The MBF Param 2"
            }
             );

            outputParameters.Add(new ParamterModel()
            {
                DataType = "System.String",
                Description = "output",
                IsInputParam = false,
                Label = "Output1",
                Name = "The MBF output 1"
            }
            );

            outputParameters.Add(new ParamterModel()
            {
                DataType = "System.Int",
                Description = "The numbers",
                IsInputParam = false,
                Label = "the num label",
                Name = "The MBF out 2"
            }
            );

            model.InputParam = inputParameters;
            model.OutboundParam = outputParameters;

                ActivityComponent component = new ActivityComponent()
                {
                     DataContext = model
                };

                ActivityEditor editor = new ActivityEditor(component, component);
            editor.Show();*/
        }
 public ResultSetEventArgs(ResultCollections results)
 {
     this.results = results;
 }