示例#1
0
 public bool Equals(HueLight obj)
 {
     if (!Id.Equals(obj.Id))
     {
         return(false);
     }
     if (!Name.Equals(obj.Name))
     {
         return(false);
     }
     if (!IsReachable.Equals(obj.IsReachable))
     {
         return(false);
     }
     if (!IsOn.Equals(obj.IsOn))
     {
         return(false);
     }
     if (!IsOn.Equals(obj.IsOn))
     {
         return(false);
     }
     if (!Brightness.Equals(obj.Brightness))
     {
         return(false);
     }
     if (!Color.Equals(obj.Color))
     {
         return(false);
     }
     return(true);
 }
示例#2
0
 public override int GetHashCode()
 {
     unchecked
     {
         return((IsOn.GetHashCode() * 397) ^ (Point != null ? Point.GetHashCode() : 0));
     }
 }
 public void SetGoActive(bool state)
 {
     IsOn.SetGoActive(state);
     BackgroundSpriteId.SetGoActive(state);
     CheckmarkSpriteId.SetGoActive(state);
     TextContent.SetGoActive(state);
 }
示例#4
0
 public override void AddBytes(List <byte> bytes)
 {
     base.AddBytes(bytes);
     IsOn.AddByte(bytes);
     HasBatteries.AddByte(bytes);
     LampPoints.AddIntBytes(bytes);
     LampPointsFromConfig.AddIntBytes(bytes);
 }
示例#5
0
        /// <summary>
        /// Save settings in ini file
        /// </summary>
        public void SaveSettings()
        {
            string line = version + ";" + presetFileName + ";" + IsOn.ToString() + ";" + useFog.ToString();

            try
            {
                StreamWriter sw = new StreamWriter(Path.Combine(pluginPath, settingsFileName));
                sw.Write(line);
                sw.Close();
            }
            catch (Exception caught) {}
        }
示例#6
0
        public override XmlNode ToXml(XmlDocument worldDoc)
        {
            XmlNode childlayerSetNode = worldDoc.CreateElement("ChildLayerSet");

            XmlAttribute name = worldDoc.CreateAttribute("Name");

            name.Value = Name;
            XmlAttribute showAtStartup = worldDoc.CreateAttribute("ShowAtStartup");

            showAtStartup.Value = IsOn.ToString();
            XmlAttribute showOnlyOneLayer = worldDoc.CreateAttribute("ShowOnlyOneLayer");

            showOnlyOneLayer.Value = ShowOnlyOneLayer.ToString();

            childlayerSetNode.Attributes.Append(name);
            childlayerSetNode.Attributes.Append(showAtStartup);
            childlayerSetNode.Attributes.Append(showOnlyOneLayer);

            m_childrenRWLock.AcquireReaderLock(Timeout.Infinite);
            try
            {
                foreach (RenderableObject ro in ChildObjects)
                {
                    /*if (ro is RenderableObjectList)
                     *  childlayerSetNode.AppendChild(saveChildLayerSet((RenderableObjectList)ro, worldDoc));
                     * if (ro is PolygonFeature)
                     *  childlayerSetNode.AppendChild(savePolygonFeature((PolygonFeature)ro, worldDoc));
                     * if (ro is LineFeature)
                     *  childlayerSetNode.AppendChild(saveLineFeature((LineFeature)ro, worldDoc));
                     * if (ro is Icons)
                     *  childlayerSetNode.AppendChild(saveIcons((Icons)ro, worldDoc));
                     * if (ro is QuadTileSet)
                     *  childlayerSetNode.AppendChild(saveQuadTileSet((QuadTileSet)ro, worldDoc));*/

                    childlayerSetNode.AppendChild(ro.ToXml(worldDoc));
                }
            }
            finally
            {
                m_childrenRWLock.ReleaseReaderLock();
            }

            return(childlayerSetNode);
        }
示例#7
0
        /// <summary>
        /// Save settings in ini file
        /// </summary>
        public void SaveSettings()
        {
            string line = version + ";"                                              // 0
                          + textureFileName + ";"                                    // 1
                          + spritePos + ";"                                          // 2
                          + showGlobe.ToString() + ";"                               // 3
                          + globeRadius.ToString(CultureInfo.InvariantCulture) + ";" // 4
                          + insetPos + ";"                                           // 5
                          + showInset.ToString() + ";"                               // 6
                          + insetWidth.ToString(CultureInfo.InvariantCulture) + ";"  // 7
                          + insetHeight.ToString(CultureInfo.InvariantCulture) + ";" // 8
                          + IsOn.ToString();                                         // 9

            try
            {
                StreamWriter sw = new StreamWriter(Path.Combine(pluginPath, settingsFileName));
                sw.Write(line);
                sw.Close();
            }
            catch (Exception caught) { }
        }
示例#8
0
 public void SetGoActive(bool state)
 {
     IsOn.SetGoActive(state);
     FrontSpriteId.SetGoActive(state);
     BackgroundSpriteId.SetGoActive(state);
 }