Ejemplo n.º 1
0
        public void save(Globals globals, string solutionName)
        {
            lock (this)
            {
                if (!changedSinceLoading)
                {
                    return;
                }

                solutionName = ParameterSerializer.getKeyFromSolutionName(solutionName);

                try
                {
                    ParameterSerializer.storeParameter(globals, RECENTLY_VIEWED_COUNT + solutionName, issues.Count);

                    int i = 1;
                    foreach (RecentlyViewedIssue issue in issues)
                    {
                        string var = RECENTLY_VIEWED_ISSUE_SERVER_GUID + solutionName + "_" + i;
                        ParameterSerializer.storeParameter(globals, var, issue.ServerGuid.ToString());
                        var = RECENTLY_VIEWED_ISSUE_KEY + solutionName + "_" + i;
                        ParameterSerializer.storeParameter(globals, var, issue.IssueKey);
                        ++i;
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine(e);
                }
            }
        }
Ejemplo n.º 2
0
        public void load(Globals globals, string solutionName)
        {
            lock (this)
            {
                issues.Clear();

                solutionName = ParameterSerializer.getKeyFromSolutionName(solutionName);

                int count = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_COUNT + solutionName, -1);
                if (count != -1)
                {
                    try
                    {
                        if (count > MAX_ITEMS)
                        {
                            count = MAX_ITEMS;
                        }

                        for (int i = 1; i <= count; ++i)
                        {
                            string guidStr            = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_ISSUE_SERVER_GUID + solutionName + "_" + i, null);
                            Guid   guid               = new Guid(guidStr);
                            string key                = ParameterSerializer.loadParameter(globals, RECENTLY_VIEWED_ISSUE_KEY + solutionName + "_" + i, null);
                            RecentlyViewedIssue issue = new RecentlyViewedIssue(guid, key);
                            issues.Add(issue);
                        }
                    }
                    catch (Exception e)
                    {
                        Debug.WriteLine(e);
                    }
                }
                changedSinceLoading = false;
            }
        }
Ejemplo n.º 3
0
        public static void load(Globals globals, string solutionName)
        {
            FILTERS.Clear();

            string solutionKey  = ParameterSerializer.getKeyFromSolutionName(solutionName);
            int    filtersCount = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_COUNT, 0);
            ICollection <JiraServer> servers = JiraServerModel.Instance.getAllServers();

            for (int i = 0; i < filtersCount; ++i)
            {
                string     filterGuidStr       = ParameterSerializer.loadParameter(globals, solutionKey + FILTER_GUID + i, null);
                Guid       filterGuid          = new Guid(filterGuidStr);
                string     filterServerGuidStr = ParameterSerializer.loadParameter(globals, getParamKey(solutionKey, filterGuid, FILTER_SERVER_GUID + filterGuidStr), null);
                Guid       serverGuid          = new Guid(filterServerGuidStr);
                JiraServer server = null;
                foreach (JiraServer s in servers)
                {
                    if (!s.GUID.Equals(serverGuid))
                    {
                        continue;
                    }
                    server = s;
                    break;
                }
                if (server == null)
                {
                    continue;
                }

                JiraCustomFilter filter = new JiraCustomFilter(server);

                loadProjects(globals, solutionKey, filterGuid, filter);
                loadIssueTypes(globals, solutionKey, filterGuid, filter);
                loadFixVersions(globals, solutionKey, filterGuid, filter);
                loadAffectsVersions(globals, solutionKey, filterGuid, filter);
                loadComponents(globals, solutionKey, filterGuid, filter);

                FILTERS[filterGuid] = filter;
            }
        }
Ejemplo n.º 4
0
        public static void save(Globals globals, string solutionName)
        {
            string solutionKey = ParameterSerializer.getKeyFromSolutionName(solutionName);

            ParameterSerializer.storeParameter(globals, solutionKey + FILTER_COUNT, FILTERS.Count);
            int i = 0;

            foreach (var filter in FILTERS)
            {
                ParameterSerializer.storeParameter(globals, solutionKey + FILTER_GUID + i, filter.Key.ToString());
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, filter.Key, FILTER_SERVER_GUID + filter.Key), filter.Key.ToString());

                JiraCustomFilter f = filter.Value;

                storeProjects(globals, solutionKey, filter.Key, f);
                storeIssueTypes(globals, solutionKey, filter.Key, f);
                storeFixVersions(globals, solutionKey, filter.Key, f);
                storeAffectsVersions(globals, solutionKey, filter.Key, f);
                storeComponents(globals, solutionKey, filter.Key, f);

                ++i;
            }
        }