示例#1
0
        // Clear the form of all info, and populate the tree with
        // libraries and catalogs for the current server
        private void NavigateToServer()
        {
            Cursor c = Cursor.Current;

            Cursor.Current = Cursors.WaitCursor;

            tvLibsCats.Nodes.Clear();
            lvMembers.Items.Clear();

            TreeNode sn = tvLibsCats.Nodes.Add(currentServer);

            sn.ImageIndex         = (int)CatImages.Server;
            sn.SelectedImageIndex = (int)CatImages.Server;
            sn.Tag = "SERVER";

            try
            {
                SasServer s = new SasServer(currentServer);
                foreach (SasLibrary lib in s.GetSasLibraries())
                {
                    if (lib.IsAssigned)
                    {
                        TreeNode tn = new TreeNode(lib.Libref);
                        tn.ImageIndex         = (int)CatImages.Library;
                        tn.SelectedImageIndex = (int)CatImages.Library;
                        tn.Tag = "LIBRARY";
                        sn.Nodes.Add(tn);

                        // add catalogs for this library
                        PopulateCatalogs(tn);
                    }
                }

                TreeNode tnf = new TreeNode(Translate.LabelUserDefinedFormats);
                tnf.ImageIndex         = (int)CatImages.Folder;
                tnf.SelectedImageIndex = (int)CatImages.Folder;
                tnf.Tag = "FMTSEARCH";
                sn.Nodes.Add(tnf);

                FmtSearch = s.GetSasSystemOptionValue("FMTSEARCH");

                PopulateUserFormats(tnf);

                // open to the Library list
                sn.Expand();
            }
            catch
            {
            }

            Cursor.Current = c;
            UpdateToolbar();
        }
        private void PopulateLibraries()
        {
            // use the SasServer.GetSasLibraries method
            // to get a collection of defined SAS libraries
            // on the active server
            SasServer          s    = cmbServer.SelectedItem as SasServer;
            IList <SasLibrary> libs = s.GetSasLibraries();

            lbLibraries.Items.Clear();
            lbLibraries.Items.AddRange(new List <SasLibrary>(libs).ToArray());

            // clear Members list, out of sync with previous selection
            lbMembers.Items.Clear();
        }
示例#3
0
        private void InitializeWithServer(SasServer server)
        {
            Cursor c = Cursor;

            try
            {
                Cursor = Cursors.Wait;

                serverLabel.Text = server.Name;

                SasLibrary[]    libraries = server.GetSasLibraries().ToArray();
                ServerViewModel model     = new ServerViewModel(libraries);
                treeView.DataContext = model;
            }
            finally
            {
                Cursor = c;
            }
        }
        private void InitializeWithServer(SasServer server)
        {
            Cursor c = Cursor;
            try
            {
                Cursor = Cursors.Wait;

                serverLabel.Text = server.Name;

                SasLibrary[] libraries = server.GetSasLibraries().ToArray();
                ServerViewModel model = new ServerViewModel(libraries);
                treeView.DataContext = model;
            }
            finally
            {
                Cursor = c;
            }
        }