Exemplo n.º 1
0
        public static string ProcessItem(System.IO.StreamWriter sw, SimPe.Events.ResourceContainer e, bool first)
        {
            string error = "";

            if (!e.HasFileDescriptor)
            {
                return("");
            }
            if (!e.HasPackage)
            {
                return("");
            }



            try
            {
                Interfaces.Files.IPackedFileDescriptor pfd     = e.Resource.FileDescriptor;
                SimPe.Interfaces.Plugin.IFileWrapper   wrapper = (SimPe.Interfaces.Plugin.IFileWrapper)FileTable.WrapperRegistry.FindHandler(pfd.Type);
                if (wrapper != null)
                {
                    wrapper.ProcessData(e.Resource);
                }

                if (first)
                {
                    WriteHeader(sw, pfd, wrapper);
                }
                WriteItem(sw, pfd, wrapper);
            }
            catch (Exception ex)
            {
                Helper.ExceptionMessage(ex);
                error += ex.Message + Helper.lbr;
            }

            return(error);
        }
Exemplo n.º 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }
            if (!(obj is ResourceContainer))
            {
                return(false);
            }

            ResourceContainer e = (ResourceContainer)obj;

            if (e.Resource == null)
            {
                return(this.Resource == null);
            }
            else if (this.Resource == null)
            {
                return(false);
            }

            return(e.Resource.Equals(this.Resource));
        }
Exemplo n.º 3
0
 /// <summary>
 /// Checks wether or not the object is already stored in the List
 /// </summary>
 /// <param name="item">The Object you are looking for</param>
 /// <returns>true, if it was found</returns>
 public bool Contains(ResourceContainer item)
 {
     return(base.Contains(item));
 }
Exemplo n.º 4
0
 /// <summary>
 /// remove an Element
 /// </summary>
 /// <param name="item">The object that should be removed</param>
 public void Remove(ResourceContainer item)
 {
     base.Remove(item);
 }
Exemplo n.º 5
0
 /// <summary>
 /// insert a new Element
 /// </summary>
 /// <param name="index">The Index where the Element should be stored</param>
 /// <param name="item">The object that should be inserted</param>
 public void Insert(int index, ResourceContainer item)
 {
     base.Insert(index, item);
 }
Exemplo n.º 6
0
 /// <summary>
 /// add a new Element
 /// </summary>
 /// <param name="item">The object you want to add</param>
 /// <returns>The index it was added on</returns>
 public int Add(ResourceContainer item)
 {
     return(base.Add(item));
 }