コード例 #1
0
ファイル: WriterContext.cs プロジェクト: r3c/verse
 public WriterContext(Stream stream, JSONSettings settings)
 {
     this.ignoreNull = settings.IgnoreNull;
     this.position = 0;
     this.currentKey = null;
     this.addComma = false;
     this.writer = new StreamWriter(stream, settings.Encoding);
 }
コード例 #2
0
ファイル: SettingsTester.cs プロジェクト: r3c/verse
        private ISchema GetSchema(JSONSettings settings)
        {
            JSONSchema	schema;

            schema = new JSONSchema (settings);
            schema.OnStreamError += (position, message) => Console.Error.WriteLine ("Stream error at position {0}: {1}", position, message);
            schema.OnTypeError += (type, value) => Console.Error.WriteLine ("Type error: could not convert \"{1}\" to {0}", type, value);

            return schema;
        }
コード例 #3
0
ファイル: GlobalSettings.cs プロジェクト: in0finite/WebBid
        static GlobalSettings()
        {
            JSONSettings savedSettings = JsonConvert.DeserializeObject <JSONSettings>(File.ReadAllText((HttpContext.Current.Server.MapPath("~/App_Data/settings.json"))));

            N = savedSettings._N;
            D = savedSettings._D;
            S = savedSettings._S;
            G = savedSettings._G;
            P = savedSettings._P;
            C = savedSettings._C;
            T = savedSettings._T;
        }
コード例 #4
0
ファイル: Settings.cs プロジェクト: rojters/Pluggis
 private void ReadSettings()
 {
     if (File.Exists(path))
     {
         using (StreamReader streamReader = File.OpenText(path))
         {
             string file = streamReader.ReadToEnd();
             settings = JsonConvert.DeserializeObject<JSONSettings>(file);
             string outMsg = "SETTINGS: " + settings.nick + ", " + settings.connection.server + ", " + settings.connection.channels[0];
             Console.WriteLine(outMsg);
             Run();
         }
     }
 }
コード例 #5
0
    internal static bool Load(string fileName, out JSONSettings settings)
    {
        string text = File.ReadAllText(fileName);

        if (string.IsNullOrWhiteSpace(text))
        {
            settings = null;
            return(false);
        }

        JSONSettings js = JsonConvert.DeserializeObject <JSONSettings>(text);

        settings = js;
        return(js != null);
    }
コード例 #6
0
        public void Init()
        {
            // コマンド定義
            this.OpenResourceDirectoryCommand.Subscribe(_ => this.openResourceDirectory());
            this.TreeItemSelectCommand.Subscribe(this.updatePreviewTab);
            this.TreeItemDoubleClickCommand.Subscribe(this.addNewTab);
            this.RenameTabHeaderCommand.Subscribe(this.RenameTabHeaderName);

            // プロパティ初期化
            this._tabSettings  = new JSONSettings <ObservableCollection <GroupTabContext> >(@"mltviewer_tabsettings.json");
            this._HukuTempPath = new JSONSettings <string>(@"mltviewer_hukutemppath.json");

            // 前回値の復帰
            this.loadSettings();
        }
コード例 #7
0
ファイル: GlobalSettings.cs プロジェクト: dukijeka/Auction
        static GlobalSettings()
        {
            JSONSettings savedSettings = JsonConvert.DeserializeObject <JSONSettings>(File.ReadAllText((HttpContext.Current.Server.MapPath("~/App_Data/settings.json"))));

            N = savedSettings._N;
            D = savedSettings._D;
            S = savedSettings._S;
            G = savedSettings._G;
            P = savedSettings._P;
            C = savedSettings._C;
            T = savedSettings._T;
            //// default values
            //N = 10;
            //D = 60;
            //S = 10;
            //G = 20;
            //P = 40;
            //C = "RSD";
            //T = 1;
        }
コード例 #8
0
    /* Получение настроек пользователя */
    public IEnumerator PostTokenForSettings()
    {
        using (UnityWebRequest www = UnityWebRequest.Post(protocol + "/api/v1/applications/moneygame/get/settings", ""))
        {
            www.SetRequestHeader("x-access-token", jsonData.token);
            yield return(www.SendWebRequest());

            if (www.isNetworkError || www.isHttpError)
            {
                _errorText.text = "Connection error";
            }
            else
            {
                string jsonString = www.downloadHandler.text;
                settings = JsonUtility.FromJson <JSONSettings>(jsonString);

                _authorizationScreen.SetActive(false);          // скрыли экран авторизации
                _walletScreen.SetActive(true);                  // открыли экран сбора денег в кошелек
            }
        }
    }
コード例 #9
0
 internal static void Save(JSONSettings settings, string fileName)
 {
     File.WriteAllText(fileName, JsonConvert.SerializeObject(settings));
 }