Ejemplo n.º 1
0
        public override object Clone()
        {
            var result = new ResourceImageProxy();

            result.CopyFrom(this);
            return(result);
        }
Ejemplo n.º 2
0
            public virtual void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
            {
                ResourceImageProxy s = (ResourceImageProxy)obj;

                info.AddValue("Url", s._url);
                info.AddValue("Name", s._name);
            }
Ejemplo n.º 3
0
            public virtual ResourceImageProxy SDeserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                ResourceImageProxy s = null != o ? (ResourceImageProxy)o : new ResourceImageProxy();

                s._url  = info.GetString("Url");
                s._name = info.GetString("Name");
                return(s);
            }
Ejemplo n.º 4
0
        public new static ImageProxy FromResource(string fullpath)
        {
            if (string.IsNullOrEmpty(fullpath))
            {
                throw new ArgumentException("Path is null or empty");
            }

            ResourceImageProxy img = new ResourceImageProxy();

            img._url  = fullpath;
            img._name = System.IO.Path.GetFileName(fullpath);
            return(img);
        }
Ejemplo n.º 5
0
        private void CopyFrom(ResourceImageProxy obj)
        {
            bool isCopied = base.CopyFrom(obj);

            if (isCopied && !object.ReferenceEquals(this, obj))
            {
                var from = obj as ResourceImageProxy;
                if (null != from)
                {
                    _url         = from._url;
                    _name        = from._name;
                    _imageSizePt = from._imageSizePt;
                    _image       = (from._image != null && from._image.IsAlive) ? new WeakReference(from._image.Target) : null;
                }
            }
        }
Ejemplo n.º 6
0
        public new static ImageProxy FromResource(string name, string fullpath)
        {
            if (string.IsNullOrEmpty(name))
            {
                throw new ArgumentException("Name is null or empty");
            }
            if (string.IsNullOrEmpty(fullpath))
            {
                throw new ArgumentException("Path is null or empty");
            }

            ResourceImageProxy img = new ResourceImageProxy();

            img._url  = fullpath;
            img._name = name;
            return(img);
        }
Ejemplo n.º 7
0
 public override object Clone()
 {
   ResourceImageProxy result = new ResourceImageProxy();
   result.CopyFrom(this);
   return result;
 }
Ejemplo n.º 8
0
    public new static ImageProxy FromResource(string name, string fullpath)
    {
      if (string.IsNullOrEmpty(name))
        throw new ArgumentException("Name is null or empty");
      if (string.IsNullOrEmpty(fullpath))
        throw new ArgumentException("Path is null or empty");

      ResourceImageProxy img = new ResourceImageProxy();
      img._url = fullpath;
      img._name = name;
      return img;
    }
Ejemplo n.º 9
0
    public new static ImageProxy FromResource(string fullpath)
    {
      if (string.IsNullOrEmpty(fullpath))
        throw new ArgumentException("Path is null or empty");

      ResourceImageProxy img = new ResourceImageProxy();
      img._url = fullpath;
      img._name = System.IO.Path.GetFileName(fullpath);
      return img;
    }
Ejemplo n.º 10
0
 private void CopyFrom(ResourceImageProxy from)
 {
   this._url = from._url;
   this._name = from._name;
   this._image = from._image;
 }
Ejemplo n.º 11
0
		private void CopyFrom(ResourceImageProxy obj)
		{
			bool isCopied = base.CopyFrom(obj);
			if (isCopied && !object.ReferenceEquals(this, obj))
			{
				var from = obj as ResourceImageProxy;
				if (null != from)
				{
					this._url = from._url;
					this._name = from._name;
					this._imageSizePt = from._imageSizePt;
					this._image = (from._image != null && from._image.IsAlive) ? new WeakReference(from._image.Target) : null;
				}
			}
		}
Ejemplo n.º 12
0
 public static ImageProxy FromResource(string fullpath)
 {
     return(ResourceImageProxy.FromResource(fullpath));
 }
Ejemplo n.º 13
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                ResourceImageProxy s = SDeserialize(o, info, parent);

                return(s);
            }
Ejemplo n.º 14
0
 private void CopyFrom(ResourceImageProxy from)
 {
     this._url   = from._url;
     this._name  = from._name;
     this._image = from._image;
 }