CrabtreeOn,印度客户定制APP,迁移2.0平台版本
陈嘉乐
2021-03-02 c404f2f369710fe72bbcc4cff2b7b8a2c11b5ff1
Crabtree/SmartHome/HDL/Operation/Device/Scene.cs
@@ -30,10 +30,15 @@
        {
            this.Type = DeviceType.Scene;
            DeviceTextID = SimpleControl.R.MyInternationalizationString.Scenes;
        }
    
        /// <summary>
        /// 场景唯一ID
        /// </summary>
        public string Sid = "";
        /// <summary>
        /// 场景小图标
@@ -44,6 +49,11 @@
        /// 场景的背景图
        /// </summary>
        public string BackgroundImagePath = "Scene/s1.png";
        /// <summary>
        /// 场景保存路径
        /// </summary>
        public string SceneFilePath = "";
        /// <summary>
        /// 根据场景路径恢复场景对象
@@ -75,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)));
        }