CrabtreeOn,印度客户定制APP,迁移2.0平台版本
wxr
2023-01-06 c05a93ddb0714a310a31574aaf030e677d9a07b6
Crabtree/SmartHome/HDL/Operation/Device/Scene.cs
@@ -31,9 +31,6 @@
            this.Type = DeviceType.Scene;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.Scenes;
            if (string.IsNullOrEmpty (SceneID)) {
                SceneID = Guid.NewGuid ().ToString ();
            }
        }
@@ -41,7 +38,7 @@
        /// <summary>
        /// 场景唯一ID
        /// </summary>
        public string SceneID = "";
        public string Sid = "";
        /// <summary>
        /// 场景小图标
@@ -52,6 +49,11 @@
        /// 场景的背景图
        /// </summary>
        public string BackgroundImagePath = "Scene/s1.png";
        /// <summary>
        /// 场景保存路径
        /// </summary>
        public string SceneFilePath = "";
        /// <summary>
        /// 根据场景路径恢复场景对象
@@ -83,6 +85,10 @@
        /// <param name="sceneFilePath">Scence file path.</param>
        public void Save (string sceneFilePath)
        {
            if(string.IsNullOrEmpty(this.SceneFilePath) || this.SceneFilePath != sceneFilePath) {
                this.SceneFilePath = sceneFilePath;
            }
            IO.FileUtils.WriteFileByBytes (sceneFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (this)));
        }