Ejemplo n.º 1
0
        void lvSubtitles_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvSubtitles.SelectedItems.Count > 0)
            {
                SubtitleElement elem = lvSubtitles.SelectedItems[0].Tag as SubtitleElement;

                string        item  = (_sub != null) ? _sub.File : string.Empty;
                List <string> items = new List <string>();
                items.Add(item);

                base.RaiseNavigationAction(NavActionType.ActionSelectFile, items, elem);
                base.RaiseNavigationAction(NavActionType.ActionReloadPreview, items, elem);
            }
        }
Ejemplo n.º 2
0
        public override void ShowProperties(List <string> strItems, object additionalData)
        {
            Translator.TranslateControl(this, DesignMode);

            try
            {
                tbContents.TextChanged     -= new EventHandler(OnContentsChanged);
                tpStartTime.OnValueChanged -= new EventHandler(OnStartTimeChanged);
                tpEndTime.OnValueChanged   -= new EventHandler(OnEndTimeChanged);
                tpDuration.OnValueChanged  -= new EventHandler(OnDurationChanged);

                _elem = additionalData as SubtitleElement;
                if (_elem != null)
                {
                    tpStartTime.Value = _elem.StartTime;
                    tpEndTime.Value   = _elem.EndTime;
                    tpDuration.Value  = (_elem.EndTime.Subtract(_elem.StartTime));

                    string rtf = _elem.RtfDisplay;
                    try
                    {
                        rtbContents.Rtf = rtf;
                    }
                    catch
                    {
                        rtbContents.Text = rtf;
                    }

                    tbContents.Lines = _elem.Lines.ToArray();
                }
            }
            finally
            {
                tbContents.TextChanged     += new EventHandler(OnContentsChanged);
                tpStartTime.OnValueChanged += new EventHandler(OnStartTimeChanged);
                tpEndTime.OnValueChanged   += new EventHandler(OnEndTimeChanged);
                tpDuration.OnValueChanged  += new EventHandler(OnDurationChanged);

                base.Modified   = false;
                btnSave.Enabled = btnUndo.Enabled = false;
            }
        }
        public override void Reload(object target)
        {
            SubtitleElement elem = target as SubtitleElement;

            if (elem != null)
            {
                StringBuilder sb = new StringBuilder();
                foreach (string line in elem.Lines)
                {
                    sb.AppendLine(line);
                }

                double seekTime = elem.StartTime.TotalSeconds / MediaRendererInstance.Instance.DurationScaleFactor;

                MediaRendererInstance.Instance.ResumeRenderer(seekTime);
                MediaRendererInstance.Instance.DisplayOsdMessage(sb.ToString());
                Thread.Sleep(500);
                MediaRendererInstance.Instance.PauseRenderer();
            }
        }
Ejemplo n.º 4
0
        public override IDeepCopyable CopyTo(IDeepCopyable other)
        {
            var dest = other as EventDefinition;

            if (dest == null)
            {
                throw new ArgumentException("Can only copy to an object of the same type", "other");
            }

            base.CopyTo(dest);
            if (UrlElement != null)
            {
                dest.UrlElement = (Hl7.Fhir.Model.FhirUri)UrlElement.DeepCopy();
            }
            if (Identifier != null)
            {
                dest.Identifier = new List <Hl7.Fhir.Model.Identifier>(Identifier.DeepCopy());
            }
            if (VersionElement != null)
            {
                dest.VersionElement = (Hl7.Fhir.Model.FhirString)VersionElement.DeepCopy();
            }
            if (NameElement != null)
            {
                dest.NameElement = (Hl7.Fhir.Model.FhirString)NameElement.DeepCopy();
            }
            if (TitleElement != null)
            {
                dest.TitleElement = (Hl7.Fhir.Model.FhirString)TitleElement.DeepCopy();
            }
            if (SubtitleElement != null)
            {
                dest.SubtitleElement = (Hl7.Fhir.Model.FhirString)SubtitleElement.DeepCopy();
            }
            if (StatusElement != null)
            {
                dest.StatusElement = (Code <Hl7.Fhir.Model.PublicationStatus>)StatusElement.DeepCopy();
            }
            if (ExperimentalElement != null)
            {
                dest.ExperimentalElement = (Hl7.Fhir.Model.FhirBoolean)ExperimentalElement.DeepCopy();
            }
            if (Subject != null)
            {
                dest.Subject = (Hl7.Fhir.Model.DataType)Subject.DeepCopy();
            }
            if (DateElement != null)
            {
                dest.DateElement = (Hl7.Fhir.Model.FhirDateTime)DateElement.DeepCopy();
            }
            if (PublisherElement != null)
            {
                dest.PublisherElement = (Hl7.Fhir.Model.FhirString)PublisherElement.DeepCopy();
            }
            if (Contact != null)
            {
                dest.Contact = new List <Hl7.Fhir.Model.ContactDetail>(Contact.DeepCopy());
            }
            if (Description != null)
            {
                dest.Description = (Hl7.Fhir.Model.Markdown)Description.DeepCopy();
            }
            if (UseContext != null)
            {
                dest.UseContext = new List <Hl7.Fhir.Model.UsageContext>(UseContext.DeepCopy());
            }
            if (Jurisdiction != null)
            {
                dest.Jurisdiction = new List <Hl7.Fhir.Model.CodeableConcept>(Jurisdiction.DeepCopy());
            }
            if (Purpose != null)
            {
                dest.Purpose = (Hl7.Fhir.Model.Markdown)Purpose.DeepCopy();
            }
            if (UsageElement != null)
            {
                dest.UsageElement = (Hl7.Fhir.Model.FhirString)UsageElement.DeepCopy();
            }
            if (Copyright != null)
            {
                dest.Copyright = (Hl7.Fhir.Model.Markdown)Copyright.DeepCopy();
            }
            if (ApprovalDateElement != null)
            {
                dest.ApprovalDateElement = (Hl7.Fhir.Model.Date)ApprovalDateElement.DeepCopy();
            }
            if (LastReviewDateElement != null)
            {
                dest.LastReviewDateElement = (Hl7.Fhir.Model.Date)LastReviewDateElement.DeepCopy();
            }
            if (EffectivePeriod != null)
            {
                dest.EffectivePeriod = (Hl7.Fhir.Model.Period)EffectivePeriod.DeepCopy();
            }
            if (Topic != null)
            {
                dest.Topic = new List <Hl7.Fhir.Model.CodeableConcept>(Topic.DeepCopy());
            }
            if (Author != null)
            {
                dest.Author = new List <Hl7.Fhir.Model.ContactDetail>(Author.DeepCopy());
            }
            if (Editor != null)
            {
                dest.Editor = new List <Hl7.Fhir.Model.ContactDetail>(Editor.DeepCopy());
            }
            if (Reviewer != null)
            {
                dest.Reviewer = new List <Hl7.Fhir.Model.ContactDetail>(Reviewer.DeepCopy());
            }
            if (Endorser != null)
            {
                dest.Endorser = new List <Hl7.Fhir.Model.ContactDetail>(Endorser.DeepCopy());
            }
            if (RelatedArtifact != null)
            {
                dest.RelatedArtifact = new List <Hl7.Fhir.Model.RelatedArtifact>(RelatedArtifact.DeepCopy());
            }
            if (Trigger != null)
            {
                dest.Trigger = new List <Hl7.Fhir.Model.TriggerDefinition>(Trigger.DeepCopy());
            }
            return(dest);
        }