public override void ToStream(Stream output)
        {
            output.Write(TLUtils.SignatureToBytes(Signature));

            Flags.ToStream(output);
            Peer.ToStream(output);
            ToStream(output, ReplyToMsgId, Flags, (int)SendFlags.ReplyToMsgId);
            MultiMedia.ToStream(output);
        }
Exemple #2
0
	    public FileInfo GetImageFilePath(MultiMedia db, Guid id)
			{
			MMPicture picture = db.MMPictures.FindOrLoad(id);
			if (picture == null)
				throw new KeyNotFoundException($"Für die ImageId {id} konnte kein Eintrag in der Datenbank gefunden werden");
			if (String.IsNullOrEmpty(picture.PlayerFileNameReference))
				throw new FileNotFoundException($"Der ImageFile {picture.PlayerFileNameReference} ist nicht vorbereitet");
			return VisualBasics.GetCentralCacheFileInfo(picture.PlayerFileNameReference);
			}
Exemple #3
0
	    public void Update(MultiMedia db, string computerName, RingMetaData ring)
			{
			MMSender sender = GetMMSenderFromSenderOrComputerName(db, computerName);
			ring.SenderId = sender.Id;
			DistributionRoot DistributionRootInstance
				= new DistributionRoot(sender.DataSet, ring);
			DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded();

			}
 public override byte[] ToBytes()
 {
     return(TLUtils.Combine(
                TLUtils.SignatureToBytes(Signature),
                Flags.ToBytes(),
                Peer.ToBytes(),
                ToBytes(ReplyToMsgId, Flags, (int)SendFlags.ReplyToMsgId),
                MultiMedia.ToBytes()
                ));
 }
Exemple #5
0
		/// <summary>
		///     Generates a complete new ring into the provided <paramref name="ring" /> dataset. This should produce a complete 24 hour active ring which has no
		///     other logic then playing the right things at the right time, independet of the past.
		/// </summary>
		/// <param name="db">The source database</param>
		/// <param name="computerName">The name of the computer this ring is generated for.</param>
		/// <param name="ring">The target ring where all the generated data should be inserted at.</param>
		/// <remarks>
		///     Things which need to be done:
		///     <para>Set <see cref="RingMetaData.SenderId" /> to the targeting sender id.</para>
		///     <para>Generate <see cref="PageGroup" />s inside the database.</para>
		///     <para>
		///         Generate <see cref="Page" />s with the associated content (<see cref="Text" />, <see cref="Image" /> <see cref="Video" />,
		///         <see cref="DoubleTransition" />).
		///     </para>
		///     <para>
		///         Generate <see cref="PageSchedule" />s. <see cref="PageSchedule" />s in sequence which belongs to the same <see cref="PageGroup" /> needs to
		///         have the same <see cref="PageSchedule.PageGroupScheduleId" />.
		///     </para>
		/// </remarks>
		public void Generate(MultiMedia db, string computerName, RingMetaData ring)
			{
			MMSender sender = GetMMSenderFromSenderOrComputerName(db, computerName);
			ring.SenderId = sender.Id;
			sender.DataSet.SetHasBeenLoaded();
			DistributionRoot DistributionRootInstance = new DistributionRoot(db, ring);
			DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded();
			DistributionRootInstance.LoadActuallBalancers(sender);
			RingGenerator ringGenerator = new RingGenerator(sender, ring, DateTime.Now);
			ringGenerator.Generate();
			}
Exemple #6
0
        // ResimKaydet metodunu KullaniciController'da da kullanacağım için static tanımladım
        public static int ResimKaydet(HttpPostedFileBase Resim, HttpContextBase ctx)
        {
            YaseminBlogSitesiMVCEntities db = new YaseminBlogSitesiMVCEntities();


            int kucukWidth  = Convert.ToInt32(ConfigurationManager.AppSettings["kw"]);
            int kucukHeight = Convert.ToInt32(ConfigurationManager.AppSettings["kh"]);
            int ortaWidth   = Convert.ToInt32(ConfigurationManager.AppSettings["ow"]);
            int ortaHeight  = Convert.ToInt32(ConfigurationManager.AppSettings["oh"]);
            int buyukWidth  = Convert.ToInt32(ConfigurationManager.AppSettings["bw"]);
            int buyukHeight = Convert.ToInt32(ConfigurationManager.AppSettings["bh"]);

            // resimlerin otomatik isimlendirmesi :
            string newName = Path.GetFileNameWithoutExtension(Resim.FileName) + "-" + Guid.NewGuid() + Path.GetExtension(Resim.FileName);

            // FromStream : resmi, boyutunu sabit olmadan çekmek için kullanılır. Bir resmi istediğimiz boyutta çekerizs.
            Image orjRes = Image.FromStream(Resim.InputStream);

            Bitmap kucukRes = new Bitmap(orjRes, kucukWidth, kucukHeight);
            Bitmap ortaRes  = new Bitmap(orjRes, ortaWidth, ortaHeight);
            Bitmap buyukRes = new Bitmap(orjRes, buyukWidth, buyukHeight);

            // Bitmap buyukRes = new Bitmap(orjRes); --> orijinal hali kalsın istersek

            kucukRes.Save(ctx.Server.MapPath("~/Content/Resimler/Kucuk/" + newName));
            ortaRes.Save(ctx.Server.MapPath("~/Content/Resimler/Orta/" + newName));
            buyukRes.Save(ctx.Server.MapPath("~/Content/Resimler/Buyuk" + newName));

            Kullanici k = (Kullanici)ctx.Session["Kullanici"];

            MultiMedia dbRes = new MultiMedia();

            dbRes.Adi           = Resim.FileName;
            dbRes.BuyukResimYol = "/Content/Resimler/Buyuk" + newName;
            dbRes.OrtaResimYol  = "/Content/Resimler/Orta" + newName;
            dbRes.KucukResimYol = "/Content/Resimler/Kucuk" + newName;
            dbRes.EklenmeTarihi = DateTime.Now;
            dbRes.EkleyenID     = k.Id;

            db.MultiMedia.Add(dbRes);
            db.SaveChanges();

            return(dbRes.Id);
        }
Exemple #7
0
 public MultimediaViewModel(MultiMedia multiMedia)
 {
     if (multiMedia is Serie)
     {
         InitSerie(multiMedia as Serie);
     }
     if (multiMedia is Movie)
     {
         InitMovie(multiMedia as Movie);
     }
     if (multiMedia is Album)
     {
         InitAlbum(multiMedia as Album);
     }
     if (multiMedia is Track)
     {
         InitTrack(multiMedia as Track);
     }
 }
Exemple #8
0
		public RingUpdater(RingPlayerDb data, MultiMedia sourceDatabase)
			{
			Player = data;
			MultimediaDb = sourceDatabase;
			}
 public void PlayMedia(MultiMedia media)
 {
     NavigationService.Navigate("FlightAppEliasGryp.ViewModels.MediaPlayerViewModel", media);
 }
Exemple #10
0
		private MMSender GetMMSenderFromSenderOrComputerName(MultiMedia multiMedia,
				String senderOrComputerName)
			{
			MMSender sender = multiMedia.MMSenders.FindOrLoad_via_NameId(senderOrComputerName);
			if (sender != null)
				return sender;
			if (sender == null)
				{
				MMPlayer player = multiMedia.MMPlayers.FindOrLoad_via_NameId(senderOrComputerName);
				if (player == null)
					player = multiMedia.MMPlayers.FindOrLoad_via_NameId(senderOrComputerName);
				if (player != null)
					return player.MMSender;
				else
					{
					return multiMedia.MMSenders.FindOrLoad_via_NameId("WohnPark");
					}
				}
			return null;
			}
Exemple #11
0
	    public void Initialize(MultiMedia db)
			{
			db.LoadAll();
			//DistributionRoot DistributionRootInstance = new DistributionRoot(db, TargetRing);
			//DistributionRootInstance DistributionRootInstance.PreloadAllForAllTodayAndTomorrowMMunitsIfNotHasBeenLoaded();
			}
Exemple #12
0
		public Stream GetImageStream(MultiMedia db, Guid imageId)
			{
			byte[] data = (byte[]) db.DbProxy.ExecuteCommand(
					$"SELECT {MMPicturesTable.ValueCol} FROM {MMPicturesTable.NativeName} WHERE {MMPicturesTable.IdCol} = '{imageId}'")
				.Rows[0][0];
			return new MemoryStream(data);

			//var bytes = new MemoryStream();
			//MMPicture picture = db.MMPictures.FindOrLoad(imageId);
			//if (picture == null)
			//	throw new KeyNotFoundException($"Für die ImageId {imageId} konnte kein Eintrag in der Datenbank gefunden werden");
			//return new MemoryStream(picture.Value);
			}