Exemplo n.º 1
0
        public void NewSolution()
        {
            CurrentSolution = new MetaPackSolution();

            RaiseEvent(new SolutionEvent
            {
                EventType = SolutionEventType.New,
                Item      = CurrentSolution
            });
        }
Exemplo n.º 2
0
        public MetaPackDataService()
        {
            CurrentSolution = new MetaPackSolution();
            CurrentOptions  = new MetaPackOptions();

            ReceiveEvent <ShOnAppLoadCompletedEvent>(OnAppLoadCompleted);
            ReceiveEvent <ShOnAppExitEvent>(OnAppExitEvent);

            NuGetConnections      = new BindingList <NuGetGalleryConnectionViewModel>();
            SharePointConnections = new BindingList <SharePointConnectionViewModel>();

            AvailableNuGetPackages = new BindingList <NuGetPackageViewModel>();
            InstalledNuGetPackages = new BindingList <NuGetPackageViewModel>();

            Settings = new MetaPackDesktopSettings();
        }
Exemplo n.º 3
0
        //private void OnSolutionEvent(SolutionEvent obj)
        //{
        //    //switch (obj.EventType)
        //    //{
        //    //    case SolutionEventType.New:
        //    //    case SolutionEventType.Opened:
        //    //    case SolutionEventType.Updated:
        //    //        UpdateSolutionTree(obj.Item);
        //    //        break;
        //    //}
        //}

        private void UpdateSolutionTree(MetaPackSolution solution)
        {
            tvConnections.Nodes.Clear();

            if (solution == null)
            {
                var urls = new string[]
                {
                    "https://portal",
                    "https://portal/departments",
                    "https://portal/departments/it",
                    "https://portal/departments/hr",
                    "https://portal/departments/rnd",
                    "https://portal/departments",
                    "https://portal/search",
                    "https://portal/kb",
                    "https://portal/heldesk",
                    "https://portal/forms-center"
                };

                foreach (var u in urls)
                {
                    var solutionNode = tvConnections.Nodes.Add(u);

                    solutionNode.Tag = u;

                    solutionNode.Nodes.Add("Installed").Tag = "Installed";
                    solutionNode.Nodes.Add("Online").Tag    = "Online";

                    //solutionNode.Expand();
                }

                return;
            }

            //foreach (var item in solution.Connections)
            //{
            //    var solutionNode = tvConnections.Nodes.Add(item.Url);

            //    solutionNode.Tag = item;

            //    solutionNode.Nodes.Add("Installed").Tag = "Installed";
            //    solutionNode.Nodes.Add("Online").Tag = "Online";

            //    solutionNode.Expand();
            //}
        }