Ejemplo n.º 1
0
        public void Save()
        {
            try
            {
                using (var r = UserAppDataRegistryForWriting)
                {
                    SetBoolean(r, "AutoStart", AutoStart);

                    SetBoolean(r, "AutoMinimize", AutoMinimize);

                    //SetBoolean(r, "DetailedErrorResponse", DetailedErrorResponse);

                    SetBoolean(r, "BindToWorld", BindToWorld);

                    SetEnum(r, "UsePlainTextConverterEnum", UsePlainTextConverter);

                    SetBoolean(r, "PostsAreAlwaysFormatFlowed", PostsAreAlwaysFormatFlowed);

                    SetInt32(r, "Port", Port);

                    SetInt32(r, "ListPageSize", ListPageSize);

                    SetInt32(r, "ArticlePageSize", ArticlePageSize);

                    SetString(r, "DomainName", DomainName);

                    SetString(r, "UserEmail", UserEmail);

                    SetString(r, "UserName", UserName);

#if LIVECONNECT
                    SetString(r, "ClientId", ClientId);
                    SetString(r, "RefreshToken", RefreshToken);
                    SetString(r, "Scopes", Scopes);
#else
                    SetString(r, "AuthenticationBlob", AuthenticationBlob);
#endif

                    SetInt32(r, "AutoLineWrap", AutoLineWrap);

                    SetString(r, "EncodingForClient", EncodingForClient);

                    SetString(r, "UserGuid", UserGuid.ToString());

                    SetEnum(r, "InMimeUse", InMimeUse);

                    SetBoolean(r, "UseAnswersForums", UseAnswersForums);

                    SetBoolean(r, "UseSocialForums", UseSocialForums);

                    SetString(r, "UserDefinedTags", UserDefinedTags.GetString());

                    SetString(r, "UserMappings", UserMappings.GetString());

                    SetBoolean(r, "DisableUserAgentInfo", DisableUserAgentInfo);

                    SetBoolean(r, "DisableLISTGROUP", DisableLISTGROUP);

                    SetBoolean(r, "ShowUserNamePostfix", ShowUserNamePostfix);

                    SetInt32(r, "TabAsSpace", TabAsSpace);

                    SetBoolean(r, "AddHistoryToArticle", AddHistoryToArticle);

                    SetEnum(r, "UseAppInsights", UseAppInsights);
                }
            }
            catch (Exception exp)
            {
                Traces.Main_TraceEvent(TraceEventType.Critical, 1, "Error saving settings to the registry: {0}", NNTPServer.Traces.ExceptionToString(exp));
            }
        }
Ejemplo n.º 2
0
        public void Save()
        {
            lock (this)
            {
                try
                {
                    using (var r = UserAppDataRegistryForWriting)
                    {
                        SetBoolean(r, "AutoStart", AutoStart);

                        SetBoolean(r, "AutoMinimize", AutoMinimize);

                        //SetBoolean(r, "DetailedErrorResponse", DetailedErrorResponse);

                        SetBoolean(r, "BindToWorld", BindToWorld);

                        SetEnum(r, "UsePlainTextConverterEnum", UsePlainTextConverter);

                        SetBoolean(r, "PostsAreAlwaysFormatFlowed", PostsAreAlwaysFormatFlowed);

                        SetInt32(r, "Port", Port);

                        //SetInt32(r, "ListPageSize", ListPageSize);

                        //SetInt32(r, "ArticlePageSize", ArticlePageSize);

                        SetString(r, "DomainName", DomainName);

                        //SetString(r, "UserEmail", UserEmail);

                        //SetString(r, "UserName", UserName);

                        SetString(r, "ClientId", ClientId);
                        SetString(r, "RefreshToken", RefreshToken);
                        SetString(r, "Scopes", Scopes);

                        //SetString(r, "AuthenticationBlob", AuthenticationBlob);

                        SetInt32(r, "AutoLineWrap", AutoLineWrap);

                        SetString(r, "EncodingForClient", EncodingForClient);

                        //SetString(r, "UserGuid", UserGuid.ToString());

                        SetEnum(r, "InMimeUse", InMimeUse);

                        //SetBoolean(r, "UseAnswersForums", UseAnswersForums);

                        //SetBoolean(r, "UseSocialForums", UseSocialForums);

                        SetString(r, "UserDefinedTags", UserDefinedTags.GetString());

                        SetString(r, "UserMappings", UserMappings.GetString());

                        SetBoolean(r, "DisableUserAgentInfo", DisableUserAgentInfo);

                        SetBoolean(r, "DisableLISTGROUP", DisableLISTGROUP);

                        SetBoolean(r, "ShowUserNamePostfix", ShowUserNamePostfix);

                        SetInt32(r, "TabAsSpace", TabAsSpace);

                        SetBoolean(r, "UseCodeColorizer", UseCodeColorizer);

                        SetBoolean(r, "AddHistoryToArticle", AddHistoryToArticle);

                        SetInt32(r, "MaxThreadCountOnFirstretrival", MaxThreadCountOnFirstRetrival);

                        SetEnum(r, "MetaInfo", MetaInfo);

                        SetBoolean(r, "ShowUsersSignature", ShowUsersSignature);

                        SetEnum(r, "UpdateInfoMode", UpdateInfoMode);

                        SetEnum(r, "MessageInfos", MessageInfos);

                        SetBoolean(r, "SendSupersedesHeader", SendSupersedesHeader);

                        SetBoolean(r, "UpdateAsync", UpdateAsync);
                    }
                }
                catch (Exception exp)
                {
                    Traces.Main_TraceEvent(TraceEventType.Critical, 1, "Error saving settings to the registry: {0}",
                                           NNTPServer.Traces.ExceptionToString(exp));
                }
            }
        }