Пример #1
0
        //Scan attributes for context lists
        private void BuildContextLists()
        {
            contextOptions = new List <ContextOption <string> >();

            GitUtility.ForEachTypeWithOrdered <StashContextAttribute>(true, (type, attribute) =>
            {
                contextOptions.Add((ContextOption <string>)Activator.CreateInstance(type));
            });
        }
Пример #2
0
        //Scan for tab attributes
        public void BuildTabList()
        {
            tabs = new List <Tab>();

            GitUtility.ForEachTypeWithOrdered <TabAttribute>(true, (type, attribute) =>
            {
                tabs.Add((Tab)Activator.CreateInstance(type));
            });
        }
Пример #3
0
        public void BuildTopButtonList()
        {
            topButtons = new List <TopButton>();

            GitUtility.ForEachTypeWithOrdered <TopButtonAttribute>(true, (type, attribute) =>
            {
                TopButton button          = (TopButton)Activator.CreateInstance(type);
                button.flexibleSpaceAfter = attribute.flexibleSpaceAfter;
                button.OnCreate();
                topButtons.Add(button);
            });
        }
Пример #4
0
        //Scan attributes for context lists
        private void BuildContextLists()
        {
            stagedContextOptions   = new List <ContextOption <string> >();
            unstagedContextOptions = new List <ContextOption <string> >();

            GitUtility.ForEachTypeWithOrdered <PathContextAttribute>(true, (type, attribute) =>
            {
                if ((attribute.mode & FilePathMode.Staged) == FilePathMode.Staged)
                {
                    stagedContextOptions.Add((ContextOption <string>)Activator.CreateInstance(type));
                }

                if ((attribute.mode & FilePathMode.Unstaged) == FilePathMode.Unstaged)
                {
                    unstagedContextOptions.Add((ContextOption <string>)Activator.CreateInstance(type));
                }
            });
        }