Beispiel #1
0
        public async void BindFromAzure()
        {
            try
            {
                syncIndicator.IsRunning = true;
                memberDatabase          = new MemberDatabase();
                // var members = memberDatabase.GetMembers();
                var sb = await manager1.GetTodoItemsAsync();

                //  var a = sb.Count();
                //   var b = members.Count();
                TextContainer.Clear();
                foreach (TodoItem var2 in sb)
                {
                    if (var2.Message.StartsWith("blobimage"))
                    {
                        int index       = var2.Message.IndexOf("blobimage");
                        var img1        = var2.Message.Substring(index + 9);
                        var imagestore2 = img1 + ".jpg";
                        var images      = DependencyService.Get <IFileService>().GetPictureFromDisk(imagestore2, getGalleryPath());
                        TextContainer.Add(new MessageText {
                            imgsource = images, imgheight = "200", imgwidth = "200", Status = var2.Status
                        });
                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }

                    else if (var2.Message.StartsWith("pdf"))
                    {
                        int index       = var2.Message.IndexOf("pdf");
                        var img1        = var2.Message.Substring(index + 3);
                        var imagestore2 = img1 + ".pdf";
                        var pdffile     = DependencyService.Get <IFileService>().GetPictureFromDisk(imagestore2, getGalleryPath());
                        //  TextContainer.Add(new MessageText { imgsource = images, imgheight = "200", imgwidth = "200", Status = var2.Status });
                        TextContainer.Add(new MessageText {
                            Text = pdffile, imgheight = "10", imgwidth = "10", Status = var2.Status
                        });

                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }

                    else
                    {
                        TextContainer.Add(new MessageText {
                            Text = var2.Message, imgheight = "10", imgwidth = "10", Status = var2.Status
                        });
                        var last3 = ListView.ItemsSource.Cast <object>().LastOrDefault();
                        ListView.ScrollTo(last3, ScrollToPosition.MakeVisible, false);
                    }
                }

                syncIndicator.IsRunning = false;
            }
            catch (Exception ex)
            {
                System.Diagnostics.Debug.WriteLine(ex);
                syncIndicator.IsRunning = false;
            }
        }
Beispiel #2
0
        public void LoadSongMetadata()
        {
            var metadata = MetadataSettings.Load(StoryDirectory);

            TextContainer.Clear();
            TextContainer.AddParagraph($"Title: {metadata.SongTitle}");
            TextContainer.AddParagraph($"Artist: {metadata.SongArtist}");
            TextContainer.AddParagraph($"Author: {metadata.StoryAuthor}");
            TextContainer.AddParagraph($"Description: {metadata.MiscDescription}");
        }
Beispiel #3
0
        private void OpenFileMenu_Click(object sender, EventArgs e)
        {
            FileDialog.Filter = "Binary file (*.bin)|*.bin";

            if (FileDialog.ShowDialog() == DialogResult.OK)
            {
                Sidebar.Nodes.Clear();
                TextContainer.Clear();
                CheckBinaryFileFormat(FileDialog.FileName);
            }
        }
Beispiel #4
0
        private void OpenFolderMenu_Click(object sender, EventArgs e)
        {
            if (FolderDialog.ShowDialog() == DialogResult.OK)
            {
                Sidebar.Nodes.Clear();
                TextContainer.Clear();

                string[] paths = Directory.EnumerateFiles(FolderDialog.SelectedPath, "*.bin", SearchOption.AllDirectories).ToArray();

                foreach (string path in paths)
                {
                    CheckBinaryFileFormat(path);
                }
            }
        }
Beispiel #5
0
		/// <summary>
		///   釋放腳本資源
		/// </summary>
		/// <param name="disposing">是否正在處理資源中</param>
		internal override void Dispose(bool disposing) {
			if (!this.__bDisposed) {
				__bDisposed = true;
				if (disposing) {
					base.Dispose(disposing);

					onScriptParameters = null;

					//清除腳本設計者所建立的物件與變數
					try {
						StopCalc();
					} catch(Exception __errExcep1) {
						if (logger.IsErrorEnabled) logger.ErrorFormat("{0}\r\n{1}", __errExcep1.Message, __errExcep1.StackTrace);
					}

					try {
						Destroy();
					} catch(Exception __errExcep2) {
						if (logger.IsErrorEnabled) logger.ErrorFormat("{0}\r\n{1}", __errExcep2.Message, __errExcep2.StackTrace);
					}

					CStudyDestroy();

					//清理使用者繪圖文字物件
					__cDrawTexts.Clear();

					//清理輸出寫入者
					OutputWriter cOutputWriter = __cOutputWriter as OutputWriter;
					cOutputWriter.Dispose();

					//清除函數與變數
					ClearFunctions();
					ClearVariables();
				}
			}
		}