Exemplo n.º 1
0
        public void save(Globals globals)
        {
            if (!changedSinceLoading)
            {
                return;
            }

            try
            {
                ParameterSerializer.storeParameter(globals, SERVER_COUNT, serverMap.Values.Count);

                int i = 1;
                foreach (JiraServer s in getAllServers())
                {
                    string var = SERVER_GUID + i;
                    ParameterSerializer.storeParameter(globals, var, s.GUID.ToString());
                    var = SERVER_NAME + s.GUID;
                    ParameterSerializer.storeParameter(globals, var, s.Name);
                    var = SERVER_URL + s.GUID;
                    ParameterSerializer.storeParameter(globals, var, s.Url);
                    CredentialsVault.Instance.saveCredentials(s);
                    ++i;
                }
            }
            catch (Exception e)
            {
                Debug.WriteLine(e);
            }
        }
Exemplo n.º 2
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);
                }
            }
        }
Exemplo n.º 3
0
        private static void storeProjects(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_COUNT), f.Projects.Count);
            int i = 0;

            foreach (JiraProject project in f.Projects)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_ID + i), project.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_PROJECT_KEY + i), project.Key);
                ++i;
            }
        }
Exemplo n.º 4
0
        private static void storeIssueTypes(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_COUNT), f.IssueTypes.Count);
            foreach (JiraNamedEntity issueType in f.IssueTypes)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_ID + i), issueType.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_ISSUE_TYPE_NAME + i), issueType.Name);
                ++i;
            }
        }
Exemplo n.º 5
0
        private static void storeFixVersions(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_COUNT), f.FixForVersions.Count);
            foreach (JiraNamedEntity version in f.FixForVersions)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_ID + i), version.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_FIXFORVERSIONS_NAME + i), version.Name);
                ++i;
            }
        }
Exemplo n.º 6
0
        private static void storeComponents(Globals globals, string solutionKey, Guid key, JiraCustomFilter f)
        {
            int i = 0;

            ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_COUNT), f.Components.Count);
            foreach (JiraNamedEntity comp in f.Components)
            {
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_ID + i), comp.Id);
                ParameterSerializer.storeParameter(globals, getParamKey(solutionKey, key, FILTER_COMPONENTS_NAME + i), comp.Name);
                ++i;
            }
        }
Exemplo n.º 7
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;
            }
        }