예제 #1
0
파일: XmlRpc.cs 프로젝트: gburca/DreamBeam
        public bool SetContent(ContentIdentity identity)
        {
            // TODO: Handle timeouts

            if (identity.Text == null)
            {
                identity.Text = "";
            }
            if (identity.SongName == null)
            {
                identity.SongName = "";
            }
            if (identity.BibleTransl == null)
            {
                identity.BibleTransl = "";
            }
            if (identity.VerseRef == null)
            {
                identity.VerseRef = "";
            }
            try {
                return((bool)Invoke("SetContent", new Object[] { identity }));
            } catch (Exception e) {
                Console.WriteLine("Could not SetContent over XML-RPC: ", e.Message);
            }
            return(false);
        }
예제 #2
0
        public ContentIdentity GetIdentity()
        {
            // TODO:  Add ImageContent.GetIdentity implementation
            ContentIdentity ident = new ContentIdentity();

            return(ident);
        }
예제 #3
0
파일: Song.cs 프로젝트: gburca/DreamBeam
        public virtual ContentIdentity GetIdentity()
        {
            ContentIdentity ident = new ContentIdentity();

            ident.Type        = (int)ContentType.Song;
            ident.SongName    = Path.GetFileName(this.FileName);
            ident.SongStrophe = this.CurrentLyric;
            return(ident);
        }
예제 #4
0
        /// <summary>
        /// If this display is a remote server it will receive a description of the content,
        /// and will have to create a content object based on that. We don't want to send
        /// actual objects to remote servers.
        /// </summary>
        /// <param name="identity">A "description" of the content</param>
        public bool SetContent(ContentIdentity identity)
        {
            IContentOperations newContent = null;
            bool success = true;

            try {
                switch ((ContentType)identity.Type)
                {
                case ContentType.BibleVerseIdx:
                    newContent = new ABibleVerse(bibleLib[identity.BibleTransl], identity.VerseIdx, Display.config);
                    break;

                case ContentType.BibleVerseRef:
                    BibleVersion bible = bibleLib[identity.BibleTransl];
                    int          idx   = bible.GetVerseIndex(identity.VerseRef);
                    newContent = new ABibleVerse(bible, idx, Display.config);
                    break;

                case ContentType.PlainText:
                    newContent = new TextToolContents(identity.Text, Display.config);
                    break;

                case ContentType.Song:
                    string songFile = DreamTools.GetDirectory(DirType.Songs, identity.SongName);
                    newContent = (Song)Song.DeserializeFrom(songFile, identity.SongStrophe, Display.config);
                    break;
                }
            } catch { }                 // Covers a multitude of sins (non-existent translation, or song, or verse, etc...)

            if (newContent != null)
            {
                if (NextDisplay != null)
                {
                    success = NextDisplay.SetContent(newContent);
                }
                if (success)
                {
                    this.content = newContent;
                    success      = this.UpdateDisplay(false);
                }
            }
            else
            {
                success = false;
            }

            return(success);
        }
예제 #5
0
파일: XmlRpc.cs 프로젝트: gburca/DreamBeam
 public bool SetContent(ContentIdentity identity)
 {
     return(mainForm.DisplayLiveServer.SetContent(identity));
 }