public void UpdateFile(File file)
        {
            var viewModel = ViewModel;

            if (viewModel == null)
            {
                return;
            }

            foreach (var item in viewModel.Items)
            {
                if (item.UpdateFile(file))
                {
                    if (Element0.Item == item)
                    {
                        Element0.UpdateFile(item, file);
                    }

                    if (Element1.Item == item)
                    {
                        Element1.UpdateFile(item, file);
                    }

                    if (Element2.Item == item)
                    {
                        Element2.UpdateFile(item, file);
                    }
                }
            }
        }
        private void Dispose()
        {
            Element2.Reset();
            Element0.Reset();
            Element1.Reset();

            if (_surface != null)
            {
                _surface.Children.Remove(_mediaPlayerElement);
                _surface = null;
            }

            if (_mediaPlayer != null)
            {
                _mediaPlayer.SourceChanged -= OnSourceChanged;
                _mediaPlayer.PlaybackSession.PlaybackStateChanged -= OnPlaybackStateChanged;

                _mediaPlayerElement.SetMediaPlayer(null);
                //_mediaPlayerElement.AreTransportControlsEnabled = false;
                //_mediaPlayerElement.TransportControls = null;
                //_mediaPlayerElement = null;

                _mediaPlayer.Dispose();
                _mediaPlayer = null;

                OnSourceChanged();
            }

            if (_request != null)
            {
                _request.RequestRelease();
                _request = null;
            }
        }
示例#3
0
        public override void CascadeStyle(string name, string value)
        {
            base.CascadeStyle(name, value);

            Element1.CascadeStyle(name, value);
            Element2.CascadeStyle(name, value);
        }
示例#4
0
    public XmlElement GenerationXMLnodeDrobi(int numTask, string Header, string Question, string AnswerCeloe, string AnswerChislitel, string AnswerZnamenatel)
    {
        XmlElement Element1;
        XmlElement Element2;

        Element1 = xmlDoc.CreateElement("Task_" + numTask);

        Element2           = xmlDoc.CreateElement("Header");
        Element2.InnerText = Header;
        Element1.AppendChild(Element2);

        Element2           = xmlDoc.CreateElement("Question");
        Element2.InnerText = Question;
        Element1.AppendChild(Element2);

        Element2           = xmlDoc.CreateElement("AnswerCeloe");
        Element2.InnerText = AnswerCeloe;
        Element1.AppendChild(Element2);

        Element2           = xmlDoc.CreateElement("AnswerChislitel");
        Element2.InnerText = AnswerChislitel;
        Element1.AppendChild(Element2);

        Element2           = xmlDoc.CreateElement("AnswerZnamenatel");
        Element2.InnerText = AnswerZnamenatel;
        Element1.AppendChild(Element2);

        Element2           = xmlDoc.CreateElement("IsAnswer");
        Element2.InnerText = "false";
        Element1.AppendChild(Element2);

        return(Element1);
    }
 protected virtual void InitializeDecimalCommand()
 {
     DecimalCommand = new RelayCommand <Button>(
         sender => { return(true); }, sender =>
     {
         if (Element1.IndexOf('.') < 0)
         {
             Element1 += '.';
         }
     });
 }
示例#6
0
 private void _read()
 {
     _category = m_io.ReadU1();
     switch (Category)
     {
     case 1: {
         _content = new Element1(m_io, this, m_root);
         break;
     }
     }
 }
示例#7
0
        private void Dispose()
        {
            Element2.Reset();
            Element0.Reset();
            Element1.Reset();

            if (_surface != null)
            {
                _surface.Children.Remove(_mediaPlayerElement);
                _surface = null;
            }

            if (_streamingInterop != null)
            {
                var interop = _streamingInterop;
                _streamingInterop = null;

                Task.Run(() => interop?.Dispose());
            }

            if (_mediaPlayer != null)
            {
                _mediaPlayer.VolumeChanged -= OnVolumeChanged;
                _mediaPlayer.SourceChanged -= OnSourceChanged;
                _mediaPlayer.MediaOpened   -= OnMediaOpened;
                _mediaPlayer.PlaybackSession.PlaybackStateChanged -= OnPlaybackStateChanged;

                _mediaPlayerElement.SetMediaPlayer(null);
                //_mediaPlayerElement.AreTransportControlsEnabled = false;
                //_mediaPlayerElement.TransportControls = null;
                //_mediaPlayerElement = null;

                if (_compactLifetime == null)
                {
                    _mediaPlayer.Dispose();
                    _mediaPlayer = null;
                }

                OnSourceChanged();
            }

            if (_request != null)
            {
                _request.RequestRelease();
                _request = null;
            }

            if (ApiInformation.IsPropertyPresent("Windows.UI.Xaml.Controls.MediaTransportControls", "ShowAndHideAutomatically"))
            {
                Transport.ShowAndHideAutomatically = false;
            }
        }
示例#8
0
        private void Dispose()
        {
            Element2.Reset();
            Element0.Reset();
            Element1.Reset();

            if (_surface != null)
            {
                _surface.Children.Remove(_mediaPlayerElement);
                _surface = null;
            }

            if (_fileStream != null)
            {
                if (_compactLifetime == null)
                {
                    _fileStream.Dispose();
                }

                _fileStream = null;
            }

            if (_mediaPlayer != null)
            {
                _mediaPlayer.VolumeChanged -= OnVolumeChanged;
                _mediaPlayer.SourceChanged -= OnSourceChanged;
                _mediaPlayer.MediaOpened   -= OnMediaOpened;
                _mediaPlayer.PlaybackSession.PlaybackStateChanged -= OnPlaybackStateChanged;

                _mediaPlayerElement.SetMediaPlayer(null);
                //_mediaPlayerElement.AreTransportControlsEnabled = false;
                //_mediaPlayerElement.TransportControls = null;
                //_mediaPlayerElement = null;

                if (_compactLifetime == null)
                {
                    _mediaPlayer.Dispose();
                }

                _mediaPlayer = null;
                OnSourceChanged();
            }

            if (_request != null)
            {
                _request.RequestRelease();
                _request = null;
            }
        }
示例#9
0
        //public Color Color
        //{
        //    set
        //    {
        //        Element1.Rectangle.Fill = new SolidColorBrush(value);
        //        Element2.Rectangle.Fill = new SolidColorBrush(value);
        //        Element3.Rectangle.Fill = new SolidColorBrush(value);
        //        Element4.Rectangle.Fill = new SolidColorBrush(value);
        //        Element5.Rectangle.Fill = new SolidColorBrush(value);
        //    }
        //}

        public a7Wait()
        {
            InitializeComponent();
            this.SizeChanged += (sender, args) =>
            {
                if (args.WidthChanged)
                {
                    Element1.Resize(this.ActualWidth);
                    Element2.Resize(this.ActualWidth);
                    Element3.Resize(this.ActualWidth);
                    Element4.Resize(this.ActualWidth);
                    Element5.Resize(this.ActualWidth);
                }
            };
        }
        protected UsingSettingCollection()
        {
            Element1 = new();
            Element2 = new();
            Element3 = new();

            Element1.SetupAllProperties();
            Element2.SetupAllProperties();
            Element3.SetupAllProperties();

            Sut = new();

            Element1.Setup(x => x.Name).Returns(Name.From("1"));
            Element2.Setup(x => x.Name).Returns(Name.From("2"));
            Element3.Setup(x => x.Name).Returns(Name.From("3"));
        }
    public void  WriteXml(System.Xml.XmlWriter writer)
    {
        writer.WriteStartElement("Service");
        writer.WriteStartElement("Element1");
        writer.WriteString(Element1.ToString());
        writer.WriteEndElement();
        writer.WriteStartElement("Element2");
        writer.WriteString(Element2.ToString());
        writer.WriteEndElement();

        foreach (string ele in Element3)
        {
            writer.WriteStartElement("Element3");
            writer.WriteString(ele);
            writer.WriteEndElement();
        }
        writer.WriteEndElement();
    }
示例#12
0
        public void ContainedCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element1.Value1Property, 1);

            element1.AssertInstanceChanged(Element1.Value1Property);
            element1.AssertChanged(Element1.Value1Property);
            element1.AssertCoerced(Element1.Value1Property);
            element1.AssertValue(Element1.Value1Property, 1);

            element2.AssertInstanceChanged();
            element2.AssertChanged();
            element2.AssertCoerced();
            element2.AssertValue(Element1.Value1Property, 0);
        }
示例#13
0
        public void NonContainedInheritsAttachedCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element2.Value2InheritsAttachedProperty, 1);

            element1.AssertInstanceChanged(Element2.Value2InheritsAttachedProperty);
            element1.AssertChanged(Element2.Value2InheritsAttachedProperty);
            element1.AssertCoerced(Element2.Value2InheritsAttachedProperty);
            element1.AssertValue(Element2.Value2InheritsAttachedProperty, 1);

            element2.AssertInstanceChanged(Element2.Value2InheritsAttachedProperty);
            element2.AssertChanged(Element2.Value2InheritsAttachedProperty);
            element2.AssertCoerced(Element2.Value2InheritsAttachedProperty);
            element2.AssertValue(Element2.Value2InheritsAttachedProperty, 1);
        }
示例#14
0
            /// <summary>
            /// Добавление элемента
            /// </summary>
            /// <param name="pen"></param>
            /// <param name="x1"></param>
            /// <param name="y1"></param>
            /// <param name="x2"></param>
            /// <param name="y2"></param>
            public override void Add(Color color, int v, Point x, Point y)
            {
                Element1 tmp = new Element1(color, v, x, y);

                if (Head == null)
                {
                    Head      = tmp;
                    Head.Next = null;
                }
                else
                {
                    Element1 t = Head;
                    while (t.Next != null)
                    {
                        t = t.Next;
                    }
                    t.Next = tmp;
                }
            }
示例#15
0
        public void NonContainedInheritsCallbackTest()
        {
            Element1 element1 = new Element1();
            Element2 element2 = new Element2();

            element2.SetParent(element1);

            element1.SetValue(Element2.Value2InheritsProperty, 1);

            element1.AssertInstanceChanged(Element2.Value2InheritsProperty);
            element1.AssertChanged();
            element1.AssertCoerced();
            element1.AssertValue(Element2.Value2InheritsProperty, 1);

            // WPF has a bug here, while element2 value is changed (through inheritance), none of these callbacks are called
            element2.AssertInstanceChanged(Element2.Value2InheritsProperty);
            element2.AssertChanged(Element2.Value2InheritsProperty);
            element2.AssertCoerced(Element2.Value2InheritsProperty);
            element2.AssertValue(Element2.Value2InheritsProperty, 1);
        }
 protected virtual void InitializeTransformSignCommand()
 {
     TransformSignCommand = new RelayCommand <Button>(
         sender => { return(true); }, sender =>
     {
         char first = Element1[0];
         if (first == '0' && Element1.Length == 1)
         {
             return;
         }
         if (first == '-')
         {
             Element1 = Element1.Substring(1);
         }
         else
         {
             Element1 = '-' + Element1;
         }
     });
 }
示例#17
0
        public void UpdateFile(File file)
        {
            var viewModel = ViewModel;

            if (viewModel == null)
            {
                return;
            }

            foreach (var item in viewModel.Items)
            {
                if (item.UpdateFile(file))
                {
                    if (Element0.Item == item)
                    {
                        Element0.UpdateFile(item, file);
                    }

                    if (Element1.Item == item)
                    {
                        Element1.UpdateFile(item, file);
                    }

                    if (Element2.Item == item)
                    {
                        Element2.UpdateFile(item, file);
                    }

                    if (_streamingInterop?.FileId == file.Id)
                    {
                        Transport.DownloadMaximum = file.Size;
                        Transport.DownloadValue   = file.Local.DownloadOffset + file.Local.DownloadedPrefixSize;
                    }
                }
            }
        }
示例#18
0
 private void Accept(Element1 element, Visitor2 visitor)
 {
     visitor.View(element);
 }
示例#19
0
 protected void Evaluate(Element1 element) =>
 Console.WriteLine($"{element.GetType().Name} visited by {GetType().Name}");
示例#20
0
 public void View(Element1 element)
 {
     Console.WriteLine("visitor1 view element1");
 }
 internal bool CheckKey(string text1, string text2)
 {
     return((Element1.Equals(text1) && Element2.Equals(text2)) || (Element1.Equals(text2) && Element2.Equals(text1)));
 }
示例#22
0
 public override int GetHashCode()
 {
     return((Element0 == null ? 0 : Element0.GetHashCode()) ^ (Element1 == null ? 0 : Element1.GetHashCode()));
 }
示例#23
0
 public bool Equals(Pair <TZero, TOne> other)
 {
     return(Element0.Equals(other.Element0) && Element1.Equals(other.Element1));
 }