示例#1
0
        public void Setup(IDataFetcher connection, bool allowEdit, bool onlyFolders)
        {
            m_connection = connection;
            m_allowEdit  = allowEdit;
            List <Schedule> lst;

            lock (Program.DataConnection)
                lst = new List <Schedule>(m_connection.GetObjects <Schedule>());

            treeView.Nodes.Clear();
            foreach (Schedule s in lst)
            {
                TreeNode t = new TreeNode(s.Name);
                t.ImageIndex = t.SelectedImageIndex = imageList.Images.IndexOfKey("Backup");
                t.Tag        = s;

                TreeNodeCollection col;

                if (string.IsNullOrEmpty(s.Path))
                {
                    col = treeView.Nodes;
                }
                else
                {
                    col = FindNode(s.Path, true);
                }

                if (!onlyFolders)
                {
                    col.Add(t);
                }
            }

            treeView.LabelEdit = m_allowEdit;
        }
 public ApplicationSettings(IDataFetcher dataparent)
 {
     m_appset = new SettingsHelper<ApplicationSetting, string, string>(dataparent, new List<ApplicationSetting>(dataparent.GetObjects<ApplicationSetting>()), "Name", "Value");
 }
示例#3
0
        public void Setup(IDataFetcher connection, bool allowEdit, bool onlyFolders)
        {
            m_connection = connection;
            m_allowEdit = allowEdit;
            List<Schedule> lst;
            lock (Program.DataConnection)
                lst = new List<Schedule>(m_connection.GetObjects<Schedule>());

            treeView.Nodes.Clear();
            foreach (Schedule s in lst)
            {
                TreeNode t = new TreeNode(s.Name);
                t.ImageIndex = t.SelectedImageIndex = imageList.Images.IndexOfKey("Backup");
                t.Tag = s;

                TreeNodeCollection col;

                if (string.IsNullOrEmpty(s.Path))
                    col = treeView.Nodes;
                else
                    col = FindNode(s.Path, true);

                if (!onlyFolders)
                    col.Add(t);
            }

            treeView.LabelEdit = m_allowEdit;
        }
 public ApplicationSettings(IDataFetcher dataparent)
 {
     m_appset = new SettingsHelper <ApplicationSetting, string, string>(dataparent, new List <ApplicationSetting>(dataparent.GetObjects <ApplicationSetting>()), "Name", "Value");
 }