Esempio n. 1
0
 //public void Remove(string item)
 //{
 //    int index = this.IndexOf(new SlideInfo(item));
 //    if (index >= 0) {
 //        this.RemoveAt(index);
 //    }
 //}
 public void Remove(SlideInfo item)
 {
     int index = this.IndexOf(item);
     if (index >= 0) {
         this.RemoveAt(index);
     }
 }
Esempio n. 2
0
        public static SlideInfo Get(int slideId)
        {
            SlideInfo slide = null;
            using (IDataReader dr = DataProvider.Instance().GetSlide(slideId)) {
                if (dr.Read()) {
                    slide = new SlideInfo();
                    slide.Load(dr);
                }
                dr.Close();
            }

            //if (slide == null)
            //    return null;

            //using (IDataReader dr = DataProvider.Instance().GetSlideObjects(slide.Id)) {
            //    while (dr.Read()) {
            //        slide.SlideObjects.Add(SlideObjectInfo.FromDataReader(dr));
            //    }
            //    dr.Close();
            //}

            return slide;
        }
Esempio n. 3
0
 public int IndexOf(SlideInfo item)
 {
     return this._Slides.IndexOf(item);
 }
Esempio n. 4
0
 //public void Insert(int index, string item)
 //{
 //    this.Insert(index, new SlideInfo(item));
 //}
 public void Insert(int index, SlideInfo item)
 {
     this._Slides.Insert(index, item);
 }
Esempio n. 5
0
 public void AddRange(SlideInfo[] items)
 {
     if (items == null) {
         throw new ArgumentNullException("items");
     }
     foreach (SlideInfo item in items) {
         this.Add(item);
     }
 }
Esempio n. 6
0
 public bool Contains(SlideInfo item)
 {
     return this._Slides.Contains(item);
 }
Esempio n. 7
0
 // Methods
 public void Add(SlideInfo slide)
 {
     this._Slides.Add(slide);
     //if (this.marked) {
     //    item.Dirty = true;
     //}
 }
Esempio n. 8
0
        void ShowSlideMessage(string message)
        {
            AutoStartSlideShow = false;
            ShowBottomButtons = false;
            ShowPlayPauseControls = false;

            Slides.Clear();

            SlideObjectInfo slide1Text = new SlideObjectInfo();
            slide1Text.ObjectType = eObjectType.Text;
            slide1Text.Text = "<font size='20px' style='font-size:20px;' color='#e24242'>" + message + "</font>";
            slide1Text.Yposition = 20;
            slide1Text.Xposition = 20;
            slide1Text.SlideFrom = eAllDirs.Left;

            SlideInfo slide1 = new SlideInfo();
            slide1.Settings = Settings;
            slide1.SlideObjects.Add(slide1Text);
            Slides.Add(slide1);
        }
        SearchItemInfo IndexSlide(ModuleInfo ModInfo, SlideInfo slide)
        {
            var title = slide.Title;
            if (string.IsNullOrEmpty(title))
                title = "Unnamed slide";

            var sb = new StringBuilder();
            foreach (SlideObjectInfo obj in slide.SlideObjects) {
                if (!string.IsNullOrEmpty(obj.Text))
                    sb.AppendFormat("{0} ", obj.Text);
            }

            return new SearchItemInfo(
                title,
                sb.ToString().Substring(0, Math.Max(100, sb.Length)), // description
                -1, // objContent.LastModifiedByUserID,
                DateTime.Now, // objContent.LastModifiedOnDate,
                ModInfo.ModuleID,
                slide.Id.ToString(),
                title + " " + sb.ToString(),
                "",
                Null.NullInteger);
        }
Esempio n. 10
0
        public void ToXml(string controlId, XmlWriter Writer, SlideInfo Slide)
        {
            Writer.WriteStartElement(ObjectType == eObjectType.Text ? "theText" : "picture");

            Writer.WriteAttributeString("x", Xposition.ToString());
            Writer.WriteAttributeString("y", Yposition.ToString());

            Writer.WriteAttributeString("opacity", Opacity.ToString());
            Writer.WriteAttributeString("glowSize", GlowSize.ToString());
            Writer.WriteAttributeString("glowColor", ColorExt.ColorToHexString(GlowColor).Replace("#", "0x"));
            Writer.WriteAttributeString("glowStrength", GlowStrength.ToString());

            Writer.WriteAttributeString("moveType", SlideMoveType.ToString());
            Writer.WriteAttributeString("easingType", SlideEasingType.ToString());
            Writer.WriteAttributeString("transitionDuration", TransitionDuration.ToString());

            Writer.WriteAttributeString("appearFrom", SlideFrom.ToString().ToLower());
            Writer.WriteAttributeString("justFade", AppearMode == eAppearMode.Fade ? "yes" : "no");

            if (ObjectType == eObjectType.Text) {

                Writer.WriteAttributeString("textColor", ColorExt.ColorToHexString(TextColor).Replace("#", "0x"));

                Writer.WriteAttributeString("verticalAlign", eVerticalAlign.Top.ToString().ToLower());// VerticalAlign.ToString().ToLower());
                Writer.WriteAttributeString("useBackground", TextBackgroundOpacity == 0 ? "no" : "yes");
                Writer.WriteAttributeString("backgroundColor", ColorExt.ColorToHexString(TextBackgroundColor).Replace("#", "0x"));
                Writer.WriteAttributeString("backgroundTransparency", TextBackgroundOpacity.ToString());
                Writer.WriteAttributeString("backgroundPadding", TextBackgroundPadding.ToString());

                if (Width > 0) {
                    Writer.WriteAttributeString("theTextWidth", Width.ToString());
                } else {
                    Writer.WriteAttributeString("theTextWidth", ((int)Slide.Settings.Width.Value - Xposition).ToString());
                }

                Writer.WriteCData(RotatorSettings.Configuration.Tokenize(controlId, Text));
            } else {
                Writer.WriteAttributeString("timeDelay", TimeDelay.ToString());

                // add effect for images and swf only
                if (EffectAfterSlide != eEffect.None) {
                    Writer.WriteAttributeString("useEffect", "yes");
                    Writer.WriteAttributeString("effect", EffectAfterSlide.ToString());
                } else {
                    Writer.WriteAttributeString("useEffect", "no");
                    Writer.WriteAttributeString("effect", "");
                }
                Writer.WriteAttributeString("theLink", FileBrowser.ResolveUrl(RotatorSettings.Configuration.Tokenize(controlId, Link)));

                Writer.WriteString(FileBrowser.ResolveUrl(RotatorSettings.Configuration.Tokenize(controlId, ObjectUrl)));
            }

            Writer.WriteEndElement(); // ("text/picture");
        }
Esempio n. 11
0
        public static SlideObjectInfo FromDataReader(IDataReader dr, SlideInfo slide)
        {
            SlideObjectInfo slideObject = new SlideObjectInfo();
            slideObject.Id = Convert.ToInt32(dr["ObjectId"].ToString());
            slideObject.SlideId = Convert.ToInt32(dr["SlideId"].ToString());
            slideObject.ObjectType = (eObjectType)Enum.Parse(typeof(eObjectType), dr["ObjectType"].ToString(), true);
            slideObject.Name = dr["Name"].ToString();
            try { slideObject.Link = dr["LinkUrl"].ToString(); } catch { }
            try { slideObject.Text = dr["Text"].ToString(); } catch { }
            try { slideObject.ObjectUrl = dr["ResourceUrl"].ToString(); } catch { }
            try { slideObject.TimeDelay = Convert.ToInt32(dr["DelaySeconds"].ToString()); } catch { }
            try { slideObject.TransitionDuration = Convert.ToInt32(dr["DurationSeconds"].ToString()); } catch { }
            try { slideObject.Opacity = Convert.ToInt32(dr["Opacity"].ToString()); } catch { }
            try { slideObject.Xposition = Convert.ToInt32(dr["PositionX"].ToString()); } catch { }
            try { slideObject.Yposition = Convert.ToInt32(dr["PositionY"].ToString()); } catch { }
            try { slideObject.Width = Convert.ToInt32(dr["Width"].ToString()); } catch { }

            try { slideObject.VerticalAlign = (eVerticalAlign)Enum.Parse(typeof(eVerticalAlign), dr["VerticalAlign"].ToString(), true); } catch { }
            try { slideObject.GlowSize = Convert.ToInt32(dr["GlowSize"].ToString()); } catch { }
            try { slideObject.GlowStrength = Convert.ToInt32(dr["GlowStrength"].ToString()); } catch { }
            try { slideObject.GlowColor = System.Drawing.Color.FromArgb(Convert.ToInt32(dr["GlowColor"].ToString().Replace("#", "0x"), 16)); } catch { }
            try { slideObject.AppearMode = (eAppearMode)Enum.Parse(typeof(eAppearMode), dr["AppearMode"].ToString(), true); } catch { }
            try { slideObject.SlideFrom = (eAllDirs)Enum.Parse(typeof(eAllDirs), dr["SlideFrom"].ToString(), true); } catch { }
            try { slideObject.SlideMoveType = (eMoveType)Enum.Parse(typeof(eMoveType), dr["SlideMoveType"].ToString(), true); } catch { }
            try { slideObject.SlideEasingType = (eEasing)Enum.Parse(typeof(eEasing), dr["SlideEasingType"].ToString(), true); } catch { }
            try { slideObject.EffectAfterSlide = (eEffect)Enum.Parse(typeof(eEffect), dr["EffectAfterSlide"].ToString(), true); } catch { }

            try { slideObject.TextColor = System.Drawing.Color.FromArgb(Convert.ToInt32(dr["TextColor"].ToString().Replace("#", "0x"), 16)); } catch { }
            try { slideObject.TextBackgroundColor = System.Drawing.Color.FromArgb(Convert.ToInt32(dr["TextBackgroundColor"].ToString().Replace("#", "0x"), 16)); } catch { }
            try { slideObject.TextBackgroundOpacity = Convert.ToInt32(dr["TextBackgroundOpacity"].ToString()); } catch { }
            try { slideObject.TextBackgroundPadding = Convert.ToInt32(dr["TextBackgroundPadding"].ToString()); } catch { }

            return slideObject;
        }