コード例 #1
0
ファイル: BedSettings.cs プロジェクト: broettge/MatterControl
		public static void SetMakeAndModel(string make, string model)
		{
			string pathToBedSettings = Path.Combine("PrinterSettings", make, model, "BedSettings.json");
			if (StaticData.Instance.FileExists(pathToBedSettings))
			{
				string content = StaticData.Instance.ReadAllText(pathToBedSettings);
				instance = (BedSettings)Newtonsoft.Json.JsonConvert.DeserializeObject<BedSettings>(content);
			}
			else
			{
				instance = new BedSettings();
			}
		}
コード例 #2
0
ファイル: BedSettings.cs プロジェクト: yg12344/MatterControl
        public static void SetMakeAndModel(string make, string model)
        {
            string pathToBedSettings = Path.Combine("PrinterSettings", make, model, "BedSettings.json");

            if (AggContext.StaticData.FileExists(pathToBedSettings))
            {
                string content = AggContext.StaticData.ReadAllText(pathToBedSettings);
                instance = (BedSettings)Newtonsoft.Json.JsonConvert.DeserializeObject <BedSettings>(content);
            }
            else
            {
                instance = new BedSettings();
            }
        }
コード例 #3
0
        public static void SetMakeAndModel(string make, string model)
        {
            string pathToBedSettings = Path.Combine(ApplicationDataStorage.Instance.ApplicationStaticDataPath, "PrinterSettings", make, model, "BedSettings.json");

            if (File.Exists(pathToBedSettings))
            {
                string content = File.ReadAllText(pathToBedSettings);
                instance = (BedSettings)Newtonsoft.Json.JsonConvert.DeserializeObject <BedSettings>(content);
            }
            else
            {
                instance = new BedSettings();
            }
        }