Пример #1
0
        void UpdateDescription()
        {
            if (descriptionRichTextBox == null)
            {
                return;
            }
            BlockCollection blocks =
                descriptionRichTextBox.Document.Blocks;

            if (treeListView.FocusedRowHandle == GridControl.InvalidRowHandle)
            {
                return;
            }
            string newDescription = list.FieldDescriptions[treeListView.FocusedRowHandle].TemplateName + "Description";

            if (newDescription == lastDescription)
            {
                return;
            }
            lastDescription = newDescription;
            ContentControl control = new ContentControl()
            {
                Template = Resources[newDescription] as ControlTemplate
            };

            control.ApplyTemplate();
            ParagraphContainer container = VisualTreeHelper.GetChild(control, 0) as ParagraphContainer;

            blocks.Clear();
            blocks.Add(container.Paragraph);
        }
Пример #2
0
        public override void ClearScripting()
        {
            BlockCollection <HsScriptsBlock> scriptBlocks = scenarioValues._scriptsList;
            BlockCollection <HsGlobalsBlock> globalBlocks = scenarioValues._globalsList;

            scriptBlocks.Clear();
            globalBlocks.Clear();

            m_scripts       = null;
            m_scriptGlobals = null;
        }
Пример #3
0
 public void EndGame()
 {
     for (int i = 0; i < BallCollection.Count; i++)
     {
         Object.Destroy((GameObject)BallCollection[i]);
     }
     BallCollection.Clear();
     for (int i = 0; i < BlockCollection.Count; i++)
     {
         Object.Destroy((GameObject)BlockCollection[i]);
     }
     BlockCollection.Clear();
     GameObject.Find("BallLauncher").GetComponent <BallLauncher>().Reset();
 }
Пример #4
0
        private async void EasterEggAnalyse(BlockCollection DestBlocks, string EasterEggText)
        {
            // 输入例如 'test text here{Image|/visglogo.jpg}this is a test'
            var SplitResult = EasterEggText.Split(new char[] { '{', '}' });

            if (myChecker5Sec.Check())
            {
                DestBlocks.Clear();
                foreach (var m in SplitResult)
                {
                    var a          = new Paragraph();
                    var b          = a.Inlines;
                    var c          = new InlineUIContainer();
                    int imageIndex = m.ToLower().IndexOf("image");
                    if (imageIndex >= 0)
                    {
                        // Image Part 输入例如 '{Image|/visglogo.jpg}'
                        var ImageUri_string = m.Split('|').ElementAt(1);
                        // 收到的的链接参数应为类似于 '/visglogo.jpg' 的格式
                        var ImageUri = new Uri(NameManager.HTTPServerAddrPrefix + ImageUri_string);
                        var d        = await ImageUri.GetImageFromNet();

                        c.Child = d;
                        b.Add(c);
                    }
                    else
                    {
                        //Text Part 输入例如 'test text here' 'this is a test'
                        var d = new TextBlock();
                        d.TextWrapping = TextWrapping.Wrap;
                        d.Text         = m;
                        d.FontSize     = 20;
                        d.Margin       = new Thickness(5);
                        c.Child        = d;
                        b.Add(c);
                    }
                    DestBlocks.Add(a);
                }
            }
        }
Пример #5
0
 /// <summary>
 /// Removes all elements from the <see cref="BigArray{T}"/>.
 /// </summary>
 public void Clear()
 {
     _blockCollection.Clear();
     Count = 0;
 }