public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Description != null)
            {
                ele.TryPathTo("Description", true, out subEle);
                Description.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (ShortName != null)
            {
                ele.TryPathTo("ShortName", true, out subEle);
                ShortName.WriteXML(subEle, master);
            }
        }
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (TextureSet != null)
     {
         TextureSet.WriteBinary(writer);
     }
     if (HavokData != null)
     {
         HavokData.WriteBinary(writer);
     }
     if (TextureSpecularExponent != null)
     {
         TextureSpecularExponent.WriteBinary(writer);
     }
     if (Grasses != null)
     {
         foreach (var item in Grasses)
         {
             item.WriteBinary(writer);
         }
     }
 }
Esempio n. 3
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Description != null)
     {
         Description.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Attributes != null)
     {
         Attributes.WriteBinary(writer);
     }
 }
Esempio n. 4
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Description != null)
     {
         Description.WriteBinary(writer);
     }
     if (Locations != null)
     {
         foreach (var item in Locations)
         {
             item.WriteBinary(writer);
         }
     }
     if (LoadScreenType != null)
     {
         LoadScreenType.WriteBinary(writer);
     }
 }
Esempio n. 5
0
        public override void Dispose()
        {
            LargeIcon.Dispose();
            SmallIcon.Dispose();

            base.Dispose();
        }
Esempio n. 6
0
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("LargeIcon", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("SmallIcon", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
        }
Esempio n. 7
0
        private void Construct(Project project)
        {
            if (project == null)
            {
                throw new ArgumentNullException("project");
            }

            Title       = "Freehand Pen";
            ToolTipText = "Draw the symbol of the object which should be created.";

            SmallIcon = global::Dataweb.NShape.Properties.Resources.FreehandIconSmall;
            SmallIcon.MakeTransparent(Color.Fuchsia);
            LargeIcon = global::Dataweb.NShape.Properties.Resources.FreehandIconLarge;
            LargeIcon.MakeTransparent(Color.Fuchsia);

            polygone      = new PathFigureShape();
            strokeSet     = new StrokeSequence();
            currentStroke = new Stroke();
            shaper        = new Shaper();

            timer          = new Timer();
            timer.Enabled  = false;
            timer.Interval = timeOut;
            timer.Elapsed += timer_Tick;

            this.project           = project;
            project.LibraryLoaded += project_LibraryLoaded;
            RegisterFigures();
        }
Esempio n. 8
0
        public override void WriteXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (Index != null)
            {
                ele.TryPathTo("Index", true, out subEle);
                Index.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
        }
 public void Dispose()
 {
     SmallIcon?.Dispose();
     LargeIcon?.Dispose();
     MessageInfo?.Dispose();
     Actions?.ToList().ForEach(c => c.Dispose());
 }
Esempio n. 10
0
        public override void WriteData(ESPWriter writer)
        {
            if (EditorID != null)
            {
                EditorID.WriteBinary(writer);
            }
            if (Name != null)
            {
                Name.WriteBinary(writer);
            }
            if (LargeIcon != null)
            {
                LargeIcon.WriteBinary(writer);
            }
            if (SmallIcon != null)
            {
                SmallIcon.WriteBinary(writer);
            }
            if (Script != null)
            {
                Script.WriteBinary(writer);
            }
            if (Description != null)
            {
                Description.WriteBinary(writer);
            }
            if (Data != null)
            {
                Data.WriteBinary(writer);
            }

            WriteValue1(writer);

            WriteValue2(writer);
        }
Esempio n. 11
0
        public override void ReadBinary(ESPReader reader)
        {
            List <string> readTags = new List <string>();

            while (reader.BaseStream.Position < reader.BaseStream.Length)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "INDX":
                    if (readTags.Contains("INDX"))
                    {
                        return;
                    }
                    Index.ReadBinary(reader);
                    break;

                case "ICON":
                    if (readTags.Contains("ICON"))
                    {
                        return;
                    }
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (readTags.Contains("MICO"))
                    {
                        return;
                    }
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "MODL":
                    if (readTags.Contains("MODL"))
                    {
                        return;
                    }
                    Model.ReadBinary(reader);
                    break;

                default:
                    return;
                }

                readTags.Add(subTag);
            }
        }
        public override void ReadDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (ele.TryPathTo("EditorID", false, out subEle))
            {
                if (EditorID == null)
                {
                    EditorID = new SimpleSubrecord <String>();
                }

                EditorID.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Name", false, out subEle))
            {
                if (Name == null)
                {
                    Name = new SimpleSubrecord <String>();
                }

                Name.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Description", false, out subEle))
            {
                if (Description == null)
                {
                    Description = new SimpleSubrecord <String>();
                }

                Description.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Large", false, out subEle))
            {
                if (LargeIcon == null)
                {
                    LargeIcon = new SimpleSubrecord <String>();
                }

                LargeIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("Icon/Small", false, out subEle))
            {
                if (SmallIcon == null)
                {
                    SmallIcon = new SimpleSubrecord <String>();
                }

                SmallIcon.ReadXML(subEle, master);
            }
            if (ele.TryPathTo("ShortName", false, out subEle))
            {
                if (ShortName == null)
                {
                    ShortName = new SimpleSubrecord <String>();
                }

                ShortName.ReadXML(subEle, master);
            }
        }
Esempio n. 13
0
 public static byte[] GetBitStream(string fileName)
 {
     using (MemoryStream ms = new MemoryStream())
     {
         LargeIcon.Save(ms, ImageFormat.Bmp);
         return(ms.ToArray());
     }
 }
Esempio n. 14
0
        public override void ReadData(ESPReader reader, long dataEnd)
        {
            while (reader.BaseStream.Position < dataEnd)
            {
                string subTag = reader.PeekTag();

                switch (subTag)
                {
                case "EDID":
                    if (EditorID == null)
                    {
                        EditorID = new SimpleSubrecord <String>();
                    }

                    EditorID.ReadBinary(reader);
                    break;

                case "FULL":
                    if (Name == null)
                    {
                        Name = new SimpleSubrecord <String>();
                    }

                    Name.ReadBinary(reader);
                    break;

                case "ICON":
                    if (LargeIcon == null)
                    {
                        LargeIcon = new SimpleSubrecord <String>();
                    }

                    LargeIcon.ReadBinary(reader);
                    break;

                case "MICO":
                    if (SmallIcon == null)
                    {
                        SmallIcon = new SimpleSubrecord <String>();
                    }

                    SmallIcon.ReadBinary(reader);
                    break;

                case "DATA":
                    if (Value == null)
                    {
                        Value = new SimpleSubrecord <Single>();
                    }

                    Value.ReadBinary(reader);
                    break;

                default:
                    throw new Exception();
                }
            }
        }
Esempio n. 15
0
        public override void WriteData(ESPWriter writer)
        {
            if (EditorID != null)
            {
                EditorID.WriteBinary(writer);
            }
            if (ObjectBounds != null)
            {
                ObjectBounds.WriteBinary(writer);
            }
            if (Name != null)
            {
                Name.WriteBinary(writer);
            }
            if (Model != null)
            {
                Model.WriteBinary(writer);
            }
            if (LargeIcon != null)
            {
                LargeIcon.WriteBinary(writer);
            }
            if (SmallIcon != null)
            {
                SmallIcon.WriteBinary(writer);
            }
            if (PickUpSound != null)
            {
                PickUpSound.WriteBinary(writer);
            }
            if (DropSound != null)
            {
                DropSound.WriteBinary(writer);
            }
            if (Type != null)
            {
                Type.WriteBinary(writer);
            }
            if (Quests != null)
            {
                foreach (var item in Quests)
                {
                    item.WriteBinary(writer);
                }
            }
            if (Image != null)
            {
                Image.WriteBinary(writer);
            }

            WriteEntryData(writer);
            if (Audio != null)
            {
                Audio.WriteBinary(writer);
            }
        }
Esempio n. 16
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (Script != null)
            {
                ele.TryPathTo("Script", true, out subEle);
                Script.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (Data != null)
            {
                ele.TryPathTo("Data", true, out subEle);
                Data.WriteXML(subEle, master);
            }
            if (FadeValue != null)
            {
                ele.TryPathTo("FadeValue", true, out subEle);
                FadeValue.WriteXML(subEle, master);
            }
            if (Sound != null)
            {
                ele.TryPathTo("Sound", true, out subEle);
                Sound.WriteXML(subEle, master);
            }
        }
Esempio n. 17
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (TextureFace != null)
     {
         TextureFace.WriteBinary(writer);
     }
     if (TextureBack != null)
     {
         TextureBack.WriteBinary(writer);
     }
     if (CardData != null)
     {
         CardData.WriteBinary(writer);
     }
     if (Value != null)
     {
         Value.WriteBinary(writer);
     }
 }
Esempio n. 18
0
        /// ------------------------------------------------------------------------------------
        /// <summary>
        ///
        /// </summary>
        /// ------------------------------------------------------------------------------------
        public void Dispose()
        {
            if (LargeIcon != null)
            {
                LargeIcon.Dispose();
            }

            if (SmallIcon != null)
            {
                SmallIcon.Dispose();
            }
        }
Esempio n. 19
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Description != null)
     {
         Description.WriteBinary(writer);
     }
     if (Destructable != null)
     {
         Destructable.WriteBinary(writer);
     }
     if (PickUpSound != null)
     {
         PickUpSound.WriteBinary(writer);
     }
     if (DropSound != null)
     {
         DropSound.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
 }
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (TextureSet != null)
            {
                ele.TryPathTo("TextureSet", true, out subEle);
                TextureSet.WriteXML(subEle, master);
            }
            if (HavokData != null)
            {
                ele.TryPathTo("HavokData", true, out subEle);
                HavokData.WriteXML(subEle, master);
            }
            if (TextureSpecularExponent != null)
            {
                ele.TryPathTo("TextureSpecularExponent", true, out subEle);
                TextureSpecularExponent.WriteXML(subEle, master);
            }
            if (Grasses != null)
            {
                ele.TryPathTo("Grasses", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Grass"
                };
                int i = 0;
                foreach (var entry in Grasses)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
        }
Esempio n. 21
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (ObjectBounds != null)
     {
         ObjectBounds.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (EquipmentType != null)
     {
         EquipmentType.WriteBinary(writer);
     }
     if (Weight != null)
     {
         Weight.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Effects != null)
     {
         foreach (var item in Effects)
         {
             item.WriteBinary(writer);
         }
     }
 }
Esempio n. 22
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (ObjectBounds != null)
            {
                ele.TryPathTo("ObjectBounds", true, out subEle);
                ObjectBounds.WriteXML(subEle, master);
            }
            if (Name != null)
            {
                ele.TryPathTo("Name", true, out subEle);
                Name.WriteXML(subEle, master);
            }
            if (Model != null)
            {
                ele.TryPathTo("Model", true, out subEle);
                Model.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (PickUpSound != null)
            {
                ele.TryPathTo("PickUpSound", true, out subEle);
                PickUpSound.WriteXML(subEle, master);
            }
            if (DropSound != null)
            {
                ele.TryPathTo("DropSound", true, out subEle);
                DropSound.WriteXML(subEle, master);
            }
            if (AbsoluteValue != null)
            {
                ele.TryPathTo("AbsoluteValue", true, out subEle);
                AbsoluteValue.WriteXML(subEle, master);
            }
        }
Esempio n. 23
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value != null)
     {
         string path = value.ToString();
         if (File.Exists(path))
         {
             return(FromStream(LargeIcon.ExtractAssociatedIcon(path as string, LargeIcon.IconSize.Size32x32).ToBitmap()));
         }
         string ext = System.IO.Path.GetExtension(path);
         return(FromStream(LargeIcon.ExtractAssociatedIcon(ext, LargeIcon.IconSize.Size32x32).ToBitmap()));
     }
     return(FromStream(LargeIcon.ExtractAssociatedIcon(".exe", LargeIcon.IconSize.Size32x32).ToBitmap()));
 }
Esempio n. 24
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
 }
Esempio n. 25
0
        /// <summary>Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.</summary>
        public void Dispose()
        {
            CanExecute    = null;
            ClickCallback = null;

            if (_ownsLargeImage)
            {
                LargeIcon.Dispose();
            }

            if (_ownsSmallImage)
            {
                SmallIcon.Dispose();
            }
        }
Esempio n. 26
0
 public override void WriteData(ESPWriter writer)
 {
     if (EditorID != null)
     {
         EditorID.WriteBinary(writer);
     }
     if (Script != null)
     {
         Script.WriteBinary(writer);
     }
     if (Name != null)
     {
         Name.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Data != null)
     {
         Data.WriteBinary(writer);
     }
     if (Conditions != null)
     {
         foreach (var item in Conditions)
         {
             item.WriteBinary(writer);
         }
     }
     if (Stages != null)
     {
         foreach (var item in Stages)
         {
             item.WriteBinary(writer);
         }
     }
     if (Objectives != null)
     {
         foreach (var item in Objectives)
         {
             item.WriteBinary(writer);
         }
     }
 }
Esempio n. 27
0
        public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
        {
            XElement subEle;

            if (EditorID != null)
            {
                ele.TryPathTo("EditorID", true, out subEle);
                EditorID.WriteXML(subEle, master);
            }
            if (LargeIcon != null)
            {
                ele.TryPathTo("Icon/Large", true, out subEle);
                LargeIcon.WriteXML(subEle, master);
            }
            if (SmallIcon != null)
            {
                ele.TryPathTo("Icon/Small", true, out subEle);
                SmallIcon.WriteXML(subEle, master);
            }
            if (Description != null)
            {
                ele.TryPathTo("Description", true, out subEle);
                Description.WriteXML(subEle, master);
            }
            if (Locations != null)
            {
                ele.TryPathTo("Locations", true, out subEle);
                List <string> xmlNames = new List <string> {
                    "Location"
                };
                int i = 0;
                foreach (var entry in Locations)
                {
                    i = i % xmlNames.Count();
                    XElement newEle = new XElement(xmlNames[i]);
                    entry.WriteXML(newEle, master);
                    subEle.Add(newEle);
                    i++;
                }
            }
            if (LoadScreenType != null)
            {
                ele.TryPathTo("LoadScreenType", true, out subEle);
                LoadScreenType.WriteXML(subEle, master);
            }
        }
Esempio n. 28
0
		public override void WriteDataXML(XElement ele, ElderScrollsPlugin master)
		{
			XElement subEle;
			if (EditorID != null)		
			{		
				ele.TryPathTo("EditorID", true, out subEle);
				EditorID.WriteXML(subEle, master);
			}
			if (ObjectBounds != null)		
			{		
				ele.TryPathTo("ObjectBounds", true, out subEle);
				ObjectBounds.WriteXML(subEle, master);
			}
			if (Model != null)		
			{		
				ele.TryPathTo("Model", true, out subEle);
				Model.WriteXML(subEle, master);
			}
			if (LargeIcon != null)		
			{		
				ele.TryPathTo("Icon/Large", true, out subEle);
				LargeIcon.WriteXML(subEle, master);
			}
			if (SmallIcon != null)		
			{		
				ele.TryPathTo("Icon/Small", true, out subEle);
				SmallIcon.WriteXML(subEle, master);
			}
			if (SpeedtreeSeeds != null)		
			{		
				ele.TryPathTo("SpeedtreeSeeds", true, out subEle);
				SpeedtreeSeeds.WriteXML(subEle, master);
			}
			if (Data != null)		
			{		
				ele.TryPathTo("Data", true, out subEle);
				Data.WriteXML(subEle, master);
			}
			if (BillboardDimensions != null)		
			{		
				ele.TryPathTo("BillboardDimensions", true, out subEle);
				BillboardDimensions.WriteXML(subEle, master);
			}
		}
Esempio n. 29
0
            /// <summary>
            /// Performs application-defined tasks associated with
            /// freeing, releasing, or resetting unmanaged resources.
            /// </summary>
            public void Dispose()
            {
                if (!disposed)
                {
                    if (SmallIcon != null)
                    {
                        SmallIcon.Dispose();
                        SmallIcon = null;
                    }
                    if (LargeIcon != null)
                    {
                        LargeIcon.Dispose();
                        LargeIcon = null;
                    }

                    disposed = true;
                    GC.SuppressFinalize(this);
                }
            }
Esempio n. 30
0
 public override void WriteBinary(ESPWriter writer)
 {
     if (Index != null)
     {
         Index.WriteBinary(writer);
     }
     if (LargeIcon != null)
     {
         LargeIcon.WriteBinary(writer);
     }
     if (SmallIcon != null)
     {
         SmallIcon.WriteBinary(writer);
     }
     if (Model != null)
     {
         Model.WriteBinary(writer);
     }
 }
Esempio n. 31
0
 private void OpenLcd()
 {
   if (!_isDisabled)
   {
     Log.Info("iMONLCDg.OpenLcd(): called");
     if (!_IMON.iMONVFD_IsInited())
     {
       Log.Info("iMONLCDg.OpenLcd(): opening display");
       Log.Info("iMONLCDg.OpenLcd(): opening display with iMONVFD_Init({0},{1})", _VfdType.ToString("x00"),
                _VfdReserved.ToString("x0000"));
       if (!_IMON.iMONVFD_Init(_VfdType, _VfdReserved))
       {
         Log.Info("iMONLCDg.OpenLcd(): Could not open display with Open({0},{1})", _VfdType.ToString("x00"),
                  _VfdReserved.ToString("x0000"));
         _isDisabled = true;
         _errorMessage = "Could not open iMON display device";
       }
       else
       {
         Log.Info("iMONLCDg.OpenLcd(): display opened");
         if (!_displayTest & ((_DisplayType == DisplayType.LCD) || (_DisplayType == DisplayType.LCD2)))
         {
           if (DisplayOptions.UseCustomFont)
           {
             CFont = new CustomFont();
             CFont.InitializeCustomFont();
           }
           if (DisplayOptions.UseLargeIcons)
           {
             CustomLargeIcon = new LargeIcon();
             CustomLargeIcon.InitializeLargeIcons();
           }
           _iconThread = new Thread(UpdateIcons)
                           {
                             IsBackground = true,
                             Priority = ThreadPriority.BelowNormal,
                             Name = "UpdateIconThread"
                           };
           _iconThread.Start();
           if (_iconThread.IsAlive)
           {
             Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.UpdateIcons() Thread Started");
           }
           else
           {
             Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.UpdateIcons() FAILED TO START");
           }
         }
         else if (!_displayTest & (_DisplayType == DisplayType.VFD))
         {
           if (EQSettings.UseEqDisplay || DisplaySettings.BlankDisplayWithVideo)
           {
             _iconThread = new Thread(VFD_EQ_Update)
                             {
                               IsBackground = true,
                               Priority = ThreadPriority.BelowNormal,
                               Name = "VFD_EQ_Update"
                             };
             _iconThread.Start();
             if (_iconThread.IsAlive)
             {
               Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.VFD_EQ_Update() Thread Started");
             }
             else
             {
               Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.VFD_EQ_Update() FAILED TO START");
             }
           }
         }
         else if ((!_displayTest & (_DisplayType == DisplayType.ThreeRsystems)) &&
                  (EQSettings.UseEqDisplay || DisplaySettings.BlankDisplayWithVideo))
         {
           _iconThread = new Thread(VFD_EQ_Update)
                           {
                             IsBackground = true,
                             Priority = ThreadPriority.BelowNormal,
                             Name = "VFD_EQ_Update"
                           };
           _iconThread.TrySetApartmentState(ApartmentState.MTA);
           _iconThread.Start();
           if (_iconThread.IsAlive)
           {
             Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.VFD_EQ_Update() Thread Started");
           }
           else
           {
             Log.Info("iMONLCDg.OpenLcd(): iMONLCDg.VFD_EQ_Update() FAILED TO START");
           }
         }
       }
     }
     else
     {
       Log.Info("iMONLCDg.OpenLcd: Display already open");
     }
     if (_MonitorPower && !_IsHandlingPowerEvent)
     {
       Log.Info("iMONLCDg.OpenLcd(): Adding Power State Monitor callback to system event thread");
       SystemEvents.PowerModeChanged += SystemEvents_PowerModeChanged;
     }
     lock (DWriteMutex)
     {
       if ((_DisplayType == DisplayType.LCD) || (_DisplayType == DisplayType.LCD2))
       {
         if (_DisplayType == DisplayType.LCD2)
         {
           SendData(iMonCommand.LCD2.ClearDisplay);
           if (_Contrast)
           {
             Log.Info("iMONLCDg.OpenLcd(): Setting LCD2 contrast level to {0}", _ContrastLevel);
             SendData(iMonCommand.General.SetContrast, _ContrastLevel);
           }
           SendData(iMonCommand.General.SetIcons);
           SendData(iMonCommand.General.SetLines0);
           SendData(iMonCommand.General.SetLines1);
           SendData(iMonCommand.General.SetLines2);
           ClearDisplay();
         }
         else
         {
           SendData(iMonCommand.LCD.ClearDisplay);
           SendData(iMonCommand.LCD.ClearAlarm);
           if (_Contrast)
           {
             Log.Info("iMONLCDg.OpenLcd(): Setting LCD contrast level to {0}", _ContrastLevel);
             SendData(iMonCommand.General.SetContrast, _ContrastLevel);
           }
           SendData(iMonCommand.General.KeypadLightOn);
         }
       }
       else if (_DisplayType == DisplayType.ThreeRsystems)
       {
         SendData(0x2020202020202000L);
         SendData(0x2020202020202002L);
         SendData(0x2020202020202004L);
         SendData(0x2020202020202006L);
         SendData(0x20202020ffffff08L);
         SendData(0x021c020000000000L);
         SendData(0x0000000000000002L);
         SendData(0x0200020000000000L);
         SendData(0x0000000000000002L);
         SendData(0x021b010000000000L);
         SendData(0x0000000000000002L);
       }
     }
     AdvancedSettings.OnSettingsChanged +=
       AdvancedSettings_OnSettingsChanged;
     ForceManagerRestart();
     Log.Info("iMONLCDg.OpenLcd(): completed");
   }
 }