/// <summary> /// Initializes FadeProxy on top of specified AxShockwaveFlash control. /// </summary> /// <param name="flashControl">AxShockwaveFlash control that contains Fade compatible SWF file.</param> public FadeProxy(AxShockwaveFlashObjects.AxShockwaveFlash flashControl) { proxy = new ExternalInterfaceProxy(flashControl); proxy.ExternalInterfaceCall += (s, e) => { switch (e.FunctionCall.FunctionName) { case "checkStatus": return(true); case "callbacksReady": Ready?.Invoke(this, EventArgs.Empty); return(null); case "stageOneInitialized": _clients[(string)e.FunctionCall.Arguments[0]]?.HandleCall(e); return(null); default: Console.WriteLine(e.FunctionCall.FunctionName); return(null); } }; }
public FlashClient(AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash, string url, TextWriter info, TextWriter error, TextWriter output, TextWriter input) : base(info, error, output, input) { this.axShockwaveFlash = axShockwaveFlash; this.url = url; handle = new AutoResetEvent(false); axShockwaveFlash.FlashCall += AxShockwaveFlash_FlashCall; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(videovoiceControl)); this.axShockwaveFlash2 = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash2)).BeginInit(); this.SuspendLayout(); // // axShockwaveFlash2 // this.axShockwaveFlash2.Enabled = true; this.axShockwaveFlash2.Location = new System.Drawing.Point(0, 0); this.axShockwaveFlash2.Name = "axShockwaveFlash2"; this.axShockwaveFlash2.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axShockwaveFlash2.OcxState"))); this.axShockwaveFlash2.Size = new System.Drawing.Size(230, 200); this.axShockwaveFlash2.TabIndex = 2; this.axShockwaveFlash2.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEventHandler(this.axShockwaveFlash2_FSCommand); // // videovoiceControl // this.Controls.Add(this.axShockwaveFlash2); this.Name = "videovoiceControl"; this.Size = new System.Drawing.Size(231, 202); this.Load += new System.EventHandler(this.videovoiceControl_Load); ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash2)).EndInit(); this.ResumeLayout(false); }
private string callFlashString(AxShockwaveFlashObjects.AxShockwaveFlash flash, string method, params object[] vals) { string response = string.Empty; StringBuilder sb = new StringBuilder(); try { foreach (var param in vals) { sb.AppendFormat("<string>{0}</string>", param); } _log.DebugFormat("Calling method: {0}[{1}]", method, sb.ToString()); lock (_lock) { response = flash.CallFunction(string.Format(METHODSTRING, method, sb.ToString())); } if (response != "<undefined/>") //void { _log.DebugFormat("Response from method: {0}[{1}] = {2}", method, sb.ToString(), response); } } catch (Exception ex) { _log.ErrorFormat("Error Calling method {0} [{1}] on flash {2}. {3}", method, sb, flash.Name, ex.ToString()); } return(response); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingForm)); this.flashContrl = new IForcePlayer(); ((System.ComponentModel.ISupportInitialize)(this.flashContrl)).BeginInit(); this.SuspendLayout(); this.flashContrl.Enabled = true; this.flashContrl.Location = new System.Drawing.Point(0, 0); this.flashContrl.Name = "flashContrl"; this.flashContrl.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("flashContrl.OcxState"))); this.flashContrl.TabIndex = 0; // // SettingForm // this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "SettingForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "SettingForm"; this.Controls.Add(this.flashContrl); ((System.ComponentModel.ISupportInitialize)(this.flashContrl)).EndInit(); Rectangle ScreenArea = System.Windows.Forms.Screen.GetBounds(this); this.ClientSize = new System.Drawing.Size(ScreenArea.Height * 3 / 2, ScreenArea.Height); this.flashContrl.Size = this.ClientSize; this.ResumeLayout(false); this.Load += new System.EventHandler(this.Main_Load); }
/// <summary> /// 开始播放课程 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnPlayCourse(object sender, RoutedEventArgs e) { TreeViewItem tvi = (TreeViewItem)sender; Hashtable tmp = (Hashtable)tvi.Tag; host.Dispose(); shockwave.Dispose(); host = new System.Windows.Forms.Integration.WindowsFormsHost(); shockwave = new AxShockwaveFlashObjects.AxShockwaveFlash(); host.Child = shockwave; //this.playerPanel.Children.Add(host); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += "\\Course\\" + tmp["mid"] + "-" + tmp["cid"] + ".swf"; shockwave.Movie = swfPath; shockwave.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(FromFlashCall); shockwave.CallFunction("<invoke name=\"c2flash\" returntype=\"xml\"><arguments><number>50</number></arguments></invoke>"); // this.changeVolume.Value = 50; shockwave.Loop = false; //this.changeVolume.ValueChanged += changeVolume_ValueChanged; cdb.OnUpCourseLook(tmp); // MessageBox.Show("开始。。。"); }
private void FlashUtil_FlashCall(AxShockwaveFlashObjects.AxShockwaveFlash flash, string function, params object[] args) { if (function == "packet") { lbPackets.Items.Add(args[0]); } }
public PreviewContainer(AxShockwaveFlashObjects.AxShockwaveFlash player) { this.player = player; InitializeComponent(); previewOptions.Player = player; this.panel.Controls.Add(player); }
/////////////////////////////////////////////////////////////////////////////// // Eventhandler for Custom Defined Events // /////////////////////////////////////////////////////////////////////////////// #region CUSTOMEVENTHANDLER #endregion //CUSTOMEVENTHANDLER #endregion //EVENTS /////////////////////////////////////////////////////////////////////////////// // Methods and Eventhandling for Background tasks // /////////////////////////////////////////////////////////////////////////////// #region BACKGROUNDWORKER #endregion //BACKGROUNDWORKER /////////////////////////////////////////////////////////////////////////////// // Inherited methods // /////////////////////////////////////////////////////////////////////////////// #region OVERRIDES #endregion //OVERRIDES /////////////////////////////////////////////////////////////////////////////// // Methods for doing main class job // /////////////////////////////////////////////////////////////////////////////// #region METHODS /// <summary> /// This method tries to initialize a flash com object. /// If this is not possible, normally due to missing /// flash player installation, it throws a com exception. /// </summary> /// <exception cref="COMException">Thrown, when activeX com object initalization fails.</exception> private void TryLoadingFlash() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartUpDialog)); this.flashTestObject = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize) this.flashTestObject).BeginInit(); // axFlashTest this.flashTestObject.Enabled = true; this.flashTestObject.Location = new System.Drawing.Point(0, 61); this.flashTestObject.Name = "axFlashTest"; this.flashTestObject.OcxState = (System.Windows.Forms.AxHost.State)resources.GetObject("axFlashTest.OcxState"); this.flashTestObject.Size = new System.Drawing.Size(34, 32); this.flashTestObject.TabIndex = 1; ((System.ComponentModel.ISupportInitialize) this.flashTestObject).EndInit(); try { this.dialogTop1.Controls.Add(this.flashTestObject); } catch (COMException) { this.dialogTop1.Controls.Remove(this.flashTestObject); throw; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FlashControl)); this.axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash1)).BeginInit(); this.SuspendLayout(); // // axShockwaveFlash1 // this.axShockwaveFlash1.Dock = System.Windows.Forms.DockStyle.Fill; this.axShockwaveFlash1.Enabled = true; this.axShockwaveFlash1.Location = new System.Drawing.Point(0, 0); this.axShockwaveFlash1.Name = "axShockwaveFlash1"; this.axShockwaveFlash1.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axShockwaveFlash1.OcxState"))); this.axShockwaveFlash1.Size = new System.Drawing.Size(150, 150); this.axShockwaveFlash1.TabIndex = 0; // // FlashControl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.axShockwaveFlash1); this.Name = "FlashControl"; ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash1)).EndInit(); this.ResumeLayout(false); this.axShockwaveFlash1.BackgroundColor = 0; }
private void AddFlash() { ax = new AxShockwaveFlashObjects.AxShockwaveFlash(); panel1.Controls.Add(ax); ax.Dock = DockStyle.Fill; ax.ScaleMode = 1; }
void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShockwaveFlash)); this.flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize)(this.flash)).BeginInit(); this.SuspendLayout(); // // flash // this.flash.Dock = System.Windows.Forms.DockStyle.Fill; this.flash.Enabled = true; this.flash.Location = new System.Drawing.Point(0, 0); this.flash.Name = "flash"; this.flash.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("flash.OcxState"))); this.flash.Size = new System.Drawing.Size(244, 200); this.flash.TabIndex = 0; // // ShockwaveFlash // this.BackColor = System.Drawing.Color.Black; this.Controls.Add(this.flash); this.Name = "ShockwaveFlash"; this.Size = new System.Drawing.Size(244, 200); ((System.ComponentModel.ISupportInitialize)(this.flash)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// set progress in the flash player. /// If no flash player then do not set the progress. /// </summary> /// <param name="value">between 0 and 100, 0 or 100 = hide</param> public static void setProgress(float value, AxShockwaveFlashObjects.AxShockwaveFlash flashobj2 = null) { //new Thread(() => { string request = "<invoke name='setBarProgress' returnType='void'><arguments><number>" + value.ToString() + "</number></arguments></invoke>"; CallFunction(request, flashobj2); //}).Start(); }
AxShockwaveFlashObjects.AxShockwaveFlash ax;//创建AxShockwaveFlash实例 private void AddFlash() { ax = new AxShockwaveFlashObjects.AxShockwaveFlash(); //实例化AxShockwaveFlash对象 panel1.Controls.Add(ax); //添加到Panel控件中 ax.Dock = DockStyle.Fill; //设置填充模式 ax.ScaleMode = 1; ax.Stop(); //停止,不播放 }
private void FlashPlayer_Load(object sender, EventArgs e) { flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); flash.Dock = DockStyle.Fill; Controls.Add(flash); //flash.WMode = "Transparent"; //BackgroundColor = Color.PowderBlue; }
private void Window_Loaded(object sender, RoutedEventArgs e) { AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash = new AxShockwaveFlashObjects.AxShockwaveFlash(); windowsFormsHost1.Child = axShockwaveFlash; string swfPath = System.Environment.CurrentDirectory; swfPath += @"\FlashPlayer\xxx.swf"; axShockwaveFlash.Movie = swfPath; //axShockwaveFlash.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(axShockwaveFlash_FlashCall); }
public Folder(AxShockwaveFlashObjects.AxShockwaveFlash flash, ListOfFiles <FileStructure> filesList, string[] includingExtenstion, string[] excludingExtenstion ) { Flash = new FlashPropertise(flash); InludingExtensionList = includingExtenstion; ExcludingExtensionList = excludingExtenstion; FilesList = filesList; }
private void FlashUtil_FlashError(AxShockwaveFlashObjects.AxShockwaveFlash flash, Exception e, string function, params object[] args) { if (Visible) { lbFlashCalls.CheckedInvoke(() => { lbFlashCalls.Items.Add($"{function} Args[{args.Length}] = {{{string.Join(",", args.Select(a => a.ToString()))}}}"); lbFlashCalls.TopIndex = lbFlashCalls.Items.Count - 1; }); } }
private void Model_StopPlay(object sender, EventArgs e) { if (first) { axShockwaveFlash = new AxShockwaveFlashObjects.AxShockwaveFlash(); windowsFormsHost1.Child = axShockwaveFlash; first = false; } //throw new NotImplementedException(); this.Stop(); }
public static void AddFlash(zeus.HelperClass.zBanner banner, System.Windows.Forms.Form f, EventHandler tar) { Point location = new Point(); Size size = new Size(); string src = banner.src; location.X = int.Parse(banner.location.Split(';')[0]); location.Y = int.Parse(banner.location.Split(';')[1]); size.Width = int.Parse(banner.size.Split(';')[0]); size.Height = int.Parse(banner.size.Split(';')[1]); try { AxShockwaveFlashObjects.AxShockwaveFlash Flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(main_menu)); ((System.ComponentModel.ISupportInitialize)(Flash)).BeginInit(); f.SuspendLayout(); // // Flash // Flash.Enabled = true; Flash.Location = location; Flash.Name = "Flash"; Flash.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("Flash.OcxState"))); Flash.Size = new Size(size.Width, size.Height); //Flash.SetZoomRect(0, 0, 1280, 184); Flash.TabIndex = 0; f.Controls.Add(Flash); ((System.ComponentModel.ISupportInitialize)(Flash)).EndInit(); f.ResumeLayout(false); Flash.LoadMovie(0, System.IO.Directory.GetCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + src); Flash.Play(); //Flash.ClientRectangle = new Rectangle(0, 0, 1280, 184); //Flash.ClientSize = size; //Flash.Dock = DockStyle.None; Flash.ScaleMode = 1; Flash.Size = new Size(size.Width, size.Height); //Flash.Pan(100, 100, 0); //Flash.Zoom(50); lFlash.Add(Flash); Ipaybox.Option["can-flash-initialize"] = "true"; } catch { Ipaybox.Option["can-flash-initialize"] = "false"; } }
/// <summary> /// Call flash inside methods in a thread safe way. /// </summary> /// <param name="req"></param> /// <param name="flash"></param> public static void CallFunction(string req, AxShockwaveFlashObjects.AxShockwaveFlash flashobj2 = null) { if (flashobj2 == null) { return; } if (flashobj2.InvokeRequired) { flashobj2.Invoke(new MethodInvoker(delegate { flashobj2.CallFunction(req); })); return; } flashobj2.CallFunction(req); }
private void Model_Play(object sender, PlayPahArgs e) { if (first) { axShockwaveFlash = new AxShockwaveFlashObjects.AxShockwaveFlash(); windowsFormsHost1.Child = axShockwaveFlash; first = false; } string swfPath = System.Environment.CurrentDirectory; swfPath += @"\FlashPlayer\xxx.swf"; //throw new NotImplementedException(); this.Show(swfPath); }
/// <summary> /// 开始播放 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void StartPlay_Click(object sender, RoutedEventArgs e) { if (playPath != "" || !String.IsNullOrEmpty(playPath)) { host = new System.Windows.Forms.Integration.WindowsFormsHost(); shockwave = new AxShockwaveFlashObjects.AxShockwaveFlash(); host.Child = shockwave; this.playerPanel.Children.Add(host); // 设置 .swf 文件相对路径 shockwave.Movie = playPath; shockwave.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(FromFlashCall); shockwave.Loop = false; this.ScaleListTreeView.IsEnabled = false; String cmd = "<invoke name=\"c2flash\" returntype=\"xml\"><arguments><string>"; if (UserInfoStatic.UserSex == "男") { cmd += "men"; } else { cmd += "women"; } cmd += "</string></arguments></invoke>"; shockwave.CallFunction(cmd); shockwave.Play(); host.Unloaded += OnRemoveFlash; ///隐藏量表列表 if (this.ScaleListGrid.Visibility == System.Windows.Visibility.Hidden) { double left = this.Margin.Left - 80; this.Margin = new Thickness(left, 0, 0, 0); this.ScaleListGrid.Visibility = System.Windows.Visibility.Visible; } else { double left = this.Margin.Left + 80; this.Margin = new Thickness(left, 0, 0, 0); this.ScaleListGrid.Visibility = System.Windows.Visibility.Hidden; } } }
private void IninitFlashComponent() { try { _flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); _flash.BeginInit(); _flash.EndInit(); FormHost.Child = _flash; _flash.Visible = false; //_flash.WMode = "transparent"; //_flash.Loop = true; _flash.OnReadyStateChange += new AxShockwaveFlashObjects._IShockwaveFlashEvents_OnReadyStateChangeEventHandler(_flash_OnReadyStateChange); } catch (Exception ex) { LogProcessorService.Log.UIService.LogError("Ininit Flash Component Failed. ", ex); } }
private void PlayEpisode(int episode, AxShockwaveFlashObjects.AxShockwaveFlash FlashControl) //Odtwórz odcinek { Control[] Cont = { btnPlay, cmbBox, linkLabel1, Stan, menuStrip1, btnToHTML, btnEpisodesList }; System.Xml.XmlTextReader XMLTxtReader = new System.Xml.XmlTextReader(Friends_from_MegaVideo_player.Properties.Settings.Default.FilePath); System.Xml.XmlDocument XMLDoc = new System.Xml.XmlDocument(); XMLDoc.Load(XMLTxtReader); XMLTxtReader.Close(); XmlNodeList nl = XMLDoc.SelectNodes("/Spis/Odcinek/NazwaOdcinka"); Friends_from_MegaVideo_player.Properties.Settings.Default.Ostatni = episode; Friends_from_MegaVideo_player.Properties.Settings.Default.Save(); this.Focus(); if ((episode < 239) | (episode > 0)) { foreach (XmlNode n in nl) { if (n.NextSibling.NextSibling.NextSibling.InnerText == episode.ToString()) //Szuka odcinka o takiej samej nazwie jak ta wyciągnięta z pliku XML { FlashControl.Movie = (n.NextSibling.NextSibling.NextSibling.NextSibling.InnerText); //Wyciągnięcie linku z pliku this.Text = "Przyjaciele Player - " + n.InnerText + " (" + n.NextSibling.NextSibling.NextSibling.InnerText + ")"; //Ustawienie nagłówka KontrolkiVisible(false, Cont); this.ClientSize = new Size(640, 481); FlashControl.Size = new Size(640, 481); frm.Maximize(this); this.Focus(); break; } } } if (episode == 239) { MessageBox.Show("To był już ostatni odcinek!"); Friends_from_MegaVideo_player.Properties.Settings.Default.Ostatni = 238; Friends_from_MegaVideo_player.Properties.Settings.Default.Save(); } if (episode == 0) { MessageBox.Show("To był pierwszy odcinek!"); Friends_from_MegaVideo_player.Properties.Settings.Default.Ostatni = 1; Friends_from_MegaVideo_player.Properties.Settings.Default.Save(); } this.Focus(); }
/// <summary> /// Добавление флеш-баннера на форму /// </summary> /// <param name="flash"></param> /// <param name="bannerList"></param> /// <param name="f"></param> /// <param name="tar"></param> public static void AddBanner(zeus.HelperClass.zBanner flash, ref AxShockwaveFlashObjects.AxShockwaveFlash banner, ref System.Windows.Forms.Form f, PreviewKeyDownEventHandler tar) { string location = flash.location; string size = flash.size; string src = flash.src; int X = int.Parse(location.Split(';')[0]); int Y = int.Parse(location.Split(';')[1]); int width = int.Parse(size.Split(';')[0]); int height = int.Parse(size.Split(';')[1]); AxShockwaveFlashObjects.AxShockwaveFlash fl = new AxShockwaveFlashObjects.AxShockwaveFlash(); fl.Stop(); fl.Size = new Size(width, height); fl.Location = new Point(X, Y); fl.Movie = Ipaybox.StartupPath + @"\" + src; fl.PreviewKeyDown += tar; f.Controls.Add(fl); }
private void OnLoadedStatus(object sender, RoutedEventArgs e) { //开始播放Flash /* this.host = new System.Windows.Forms.Integration.WindowsFormsHost(); * shockwave = new AxShockwaveFlashObjects.AxShockwaveFlash(); * host.Child = shockwave; * this.BallGrid.Children.Add(host); * * string swfPath = System.Environment.CurrentDirectory; * swfPath += "\\S\\Ball.swf";//556x128 * // 设置 .swf 文件相对路径 * shockwave.Movie = swfPath; * String cmd = "<invoke name=\"c2flash\" returntype=\"xml\"><arguments><number>1</number></arguments></invoke>"; * shockwave.FlashCall += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FlashCallEventHandler(FromFlashData); * shockwave.CallFunction(cmd); * shockwave.Play(); * //调整ep槽 * OnAnimationForEP(0); */ this.host = new System.Windows.Forms.Integration.WindowsFormsHost(); shockwave = new AxShockwaveFlashObjects.AxShockwaveFlash(); host.Child = shockwave; this.StatusGrid.Children.Add(host); shockwave.BGColor = "28A9ED"; if (shockwave.IsPlaying()) { shockwave.Stop(); shockwave.Refresh(); } /* string swfPath = System.Environment.CurrentDirectory; * swfPath += "\\S\\s3.swf";//556x128 * // 设置 .swf 文件相对路径 * shockwave.Movie = swfPath; * shockwave.BGColor = "1E78E7"; * shockwave.Play(); */ }
private void loadFlash() { // 创建 host 对象 System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // 实例化 axShockwaveFlash1 AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); // 装载.axShockwaveFlash1 host.Child = axShockwaveFlash1; axShockwaveFlash1.Width = 1366; axShockwaveFlash1.Height = 599; //将 host 对象嵌入FlashGrid this.touchPad.Children.Add(host); Canvas.SetTop(host, 91); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += @"\demo.swf"; axShockwaveFlash1.Movie = swfPath; axShockwaveFlash1.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEventHandler(this.axShockwaveFlash1_FSCommand); }
private string callFlashEmpty(AxShockwaveFlashObjects.AxShockwaveFlash flash, string method) { string response = string.Empty; try { _log.DebugFormat("Calling method: {0}", method); lock (_lock) { response = flash.CallFunction(string.Format(METHODEMPTY, method)); } if (response != "<undefined/>") //void { _log.DebugFormat("Response from method: {0} = {1}", method, response); } } catch (Exception ex) { _log.ErrorFormat("Error Calling method {0} on flash {1}. {2}", method, flash.Name, ex.ToString()); } return(response); }
//int CurrentUser = Convert.ToInt32(c1); private void Window_Loaded(object sender, RoutedEventArgs e) { // 创建 host 对象 System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // 实例化 axShockwaveFlash1 AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); // 装载.axShockwaveFlash1 host.Child = axShockwaveFlash1; // 将 host 对象嵌入FlashGrid this.FlashGrid.Children.Add(host); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += @"\1.swf"; axShockwaveFlash1.Movie = swfPath; label1.Visibility = System.Windows.Visibility.Hidden; label5.Visibility = System.Windows.Visibility.Hidden; startKinect(); //kinectSensorChooser1.KinectSensorChanged += new DependencyPropertyChangedEventHandler(kinectSensorChooser1_KinectSensorChanged); }
private void LoadSwf() { if (playing) { this.Controls.Remove(axFlash); axFlash.Dispose(); } axFlash = new AxShockwaveFlashObjects.AxShockwaveFlash(); axFlash.BeginInit(); axFlash.Location = new Point(0, 0); axFlash.Name = "Main"; axFlash.TabIndex = 0; ResizeGameWindow(); axFlash.EndInit(); this.Controls.Add(axFlash); axFlash.WMode = "Direct"; // axFlash.ScaleMode = 1; axFlash.SetVariable("quality", "Medium"); axFlash.Quality = quality; axFlash.LoadMovie(0, protocol + "://s" + server + "-ddt.7tgames.com//" + GetSwfUrl(session)); axFlash.DisableLocalSecurity(); }
/// <summary> /// Changes the channel to the selected channel given. /// </summary> private void ChannelSelected(string name) { _currentChannel = name; TitleProcessor(); this.flashPanel.Controls.Remove(flashPlayer); flashPlayer.Dispose(); flashPlayer = new AxShockwaveFlashObjects.AxShockwaveFlash(); flashPlayer.BeginInit(); flashPlayer.Name = "flashPlayer"; flashPlayer.EndInit(); this.flashPanel.Controls.Add(flashPlayer); flashPlayer.WMode = "Direct"; flashPlayer.EmbedMovie = false; flashPlayer.AllowNetworking = "all"; flashPlayer.AllowScriptAccess = "always"; flashPlayer.FlashVars = "hostname=www.twitch.tv&channel=" + name + "&auto_play=true&start_volume=100"; flashPlayer.LoadMovie(0, "http://www.twitch.tv/widgets/live_embed_player.swf"); FlashPanelResize(null,null); this.chatPanel.DocumentText = "<html><head></head><body style=\"margin: 0px; padding 0px; width: 350px; \"><iframe frameborder=\"0\" scrolling=\"no\" id=\"chat_embed\" src=\"http://twitch.tv/chat/embed?channel=" + name + "&popout_chat=true\" height=\"100%\" width=\"350\"></iframe></body></html>"; // Create a channel object to do all of the Twitch API stuff. if (_channel != null) { _channel.Dispose(); } _channel = new Channel(Properties.Resources.icon); _channel.Loaded += ChannelLoaded; _channel.GameChanged += GameChanged; _channel.Initialise(name); }
/// <summary> /// Initializes a new instance of the MainWindow class. /// </summary> //public MainWindow() //{ // InitializeComponent(); //} /// <summary> /// Execute startup tasks /// </summary> /// <param name="sender">object sending the event</param> /// <param name="e">event arguments</param> private void WindowLoaded(object sender, RoutedEventArgs e) { System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); host.Child = axShockwaveFlash1; this.FlashGrid.Children.Add(host); string swfPath = System.Environment.CurrentDirectory; //load swf path swfPath += @"\sample.swf"; axShockwaveFlash1.Movie = swfPath; // Look through all sensors and start the first connected one. // This requires that a Kinect is connected at the time of app startup. // To make your app robust against plug/unplug, // it is recommended to use KinectSensorChooser provided in Microsoft.Kinect.Toolkit (See components in Toolkit Browser). foreach (var potentialSensor in KinectSensor.KinectSensors) { if (potentialSensor.Status == KinectStatus.Connected) { this.sensor = potentialSensor; break; } } if (null != this.sensor) { // Turn on the depth stream to receive depth frames this.sensor.DepthStream.Enable(DepthFormat); this.depthWidth = this.sensor.DepthStream.FrameWidth; this.depthHeight = this.sensor.DepthStream.FrameHeight; this.sensor.ColorStream.Enable(ColorFormat); int colorWidth = this.sensor.ColorStream.FrameWidth; int colorHeight = this.sensor.ColorStream.FrameHeight; this.colorToDepthDivisor = colorWidth / this.depthWidth; // Turn on to get player masks this.sensor.SkeletonStream.Enable(); // Allocate space to put the depth pixels we'll receive this.depthPixels = new DepthImagePixel[this.sensor.DepthStream.FramePixelDataLength]; // Allocate space to put the color pixels we'll create this.colorPixels = new byte[this.sensor.ColorStream.FramePixelDataLength]; this.greenScreenPixelData = new int[this.sensor.DepthStream.FramePixelDataLength]; this.colorCoordinates = new ColorImagePoint[this.sensor.DepthStream.FramePixelDataLength]; // This is the bitmap we'll display on-screen this.colorBitmap = new WriteableBitmap(colorWidth, colorHeight, 96.0, 96.0, PixelFormats.Bgr32, null); // Set the image we display to point to the bitmap where we'll put the image data this.MaskedColor.Source = this.colorBitmap; // Add an event handler to be called whenever there is new depth frame data this.sensor.AllFramesReady += this.SensorAllFramesReady; // Start the sensor! try { this.sensor.Start(); } catch (IOException) { this.sensor = null; } } if (null == this.sensor) { this.statusBarText.Text = Properties.Resources.NoKinectReady; } }
private void loadFlash() { // 创建 host 对象 System.Windows.Forms.Integration.WindowsFormsHost host = new System.Windows.Forms.Integration.WindowsFormsHost(); // 实例化 axShockwaveFlash1 AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1 = new AxShockwaveFlashObjects.AxShockwaveFlash(); // 装载.axShockwaveFlash1 host.Child = axShockwaveFlash1; axShockwaveFlash1.Width = 1366; axShockwaveFlash1.Height = 599; //将 host 对象嵌入FlashGrid this.touchPad.Children.Add(host); Canvas.SetTop(host, 91); // 设置 .swf 文件相对路径 string swfPath = System.Environment.CurrentDirectory; swfPath += @"\demo.swf"; axShockwaveFlash1.Movie = swfPath; axShockwaveFlash1.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEventHandler(this.axShockwaveFlash1_FSCommand); }
/// <summary> /// 设计器支持所需的方法 - 不要 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Map)); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.panel1 = new System.Windows.Forms.Panel(); this.panel3 = new System.Windows.Forms.Panel(); this.panel2 = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.IntrovertIMApp = new AxShockwaveFlashObjects.AxShockwaveFlash(); this.tmrSetLocation = new System.Windows.Forms.Timer(this.components); this.panel1.SuspendLayout(); this.panel3.SuspendLayout(); this.panel2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.IntrovertIMApp)).BeginInit(); this.SuspendLayout(); // // flowLayoutPanel1 // this.flowLayoutPanel1.AutoScroll = true; this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(456, 696); this.flowLayoutPanel1.TabIndex = 0; this.flowLayoutPanel1.Paint += new System.Windows.Forms.PaintEventHandler(this.flowLayoutPanel1_Paint_1); // // timer1 // this.timer1.Interval = 3500; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // panel1 // this.panel1.Controls.Add(this.panel3); this.panel1.Controls.Add(this.panel2); this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(456, 760); this.panel1.TabIndex = 1; // // panel3 // this.panel3.Controls.Add(this.flowLayoutPanel1); this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(0, 64); this.panel3.Name = "panel3"; this.panel3.Size = new System.Drawing.Size(456, 696); this.panel3.TabIndex = 2; // // panel2 // this.panel2.Controls.Add(this.button1); this.panel2.Controls.Add(this.label1); this.panel2.Dock = System.Windows.Forms.DockStyle.Top; this.panel2.Location = new System.Drawing.Point(0, 0); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(456, 64); this.panel2.TabIndex = 1; // // button1 // this.button1.Image = global::newlistview.Properties.Resources.play; this.button1.Location = new System.Drawing.Point(257, 6); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(55, 55); this.button1.TabIndex = 1; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // label1 // this.label1.AutoSize = true; this.label1.Font = new System.Drawing.Font("微软雅黑", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.Location = new System.Drawing.Point(93, 18); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(134, 31); this.label1.TabIndex = 0; this.label1.Text = "循环切换:"; // // IntrovertIMApp // this.IntrovertIMApp.Dock = System.Windows.Forms.DockStyle.Fill; this.IntrovertIMApp.Enabled = true; this.IntrovertIMApp.Location = new System.Drawing.Point(456, 0); this.IntrovertIMApp.Name = "IntrovertIMApp"; this.IntrovertIMApp.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("IntrovertIMApp.OcxState"))); this.IntrovertIMApp.Size = new System.Drawing.Size(924, 760); this.IntrovertIMApp.TabIndex = 2; this.IntrovertIMApp.Enter += new System.EventHandler(this.IntrovertIMApp_Enter); // // tmrSetLocation // this.tmrSetLocation.Tick += new System.EventHandler(this.tmrSetLocation_Tick); // // Map // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1380, 760); this.Controls.Add(this.IntrovertIMApp); this.Controls.Add(this.panel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Name = "Map"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.Load += new System.EventHandler(this.Form1_Load); this.panel1.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel2.ResumeLayout(false); this.panel2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.IntrovertIMApp)).EndInit(); this.ResumeLayout(false); }
/////////////////////////////////////////////////////////////////////////////// // Eventhandler for Custom Defined Events // /////////////////////////////////////////////////////////////////////////////// #region CUSTOMEVENTHANDLER #endregion //CUSTOMEVENTHANDLER #endregion //EVENTS /////////////////////////////////////////////////////////////////////////////// // Methods and Eventhandling for Background tasks // /////////////////////////////////////////////////////////////////////////////// #region BACKGROUNDWORKER #endregion //BACKGROUNDWORKER /////////////////////////////////////////////////////////////////////////////// // Inherited methods // /////////////////////////////////////////////////////////////////////////////// #region OVERRIDES #endregion //OVERRIDES /////////////////////////////////////////////////////////////////////////////// // Methods for doing main class job // /////////////////////////////////////////////////////////////////////////////// #region METHODS /// <summary> /// This method tries to initialize a flash com object. /// If this is not possible, normally due to missing /// flash player installation, it throws a com exception. /// </summary> /// <exception cref="COMException">Thrown, when activeX com object initalization fails.</exception> private void TryLoadingFlash() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(StartUpDialog)); this.flashTestObject = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize)this.flashTestObject).BeginInit(); // axFlashTest this.flashTestObject.Enabled = true; this.flashTestObject.Location = new System.Drawing.Point(0, 61); this.flashTestObject.Name = "axFlashTest"; this.flashTestObject.OcxState = (System.Windows.Forms.AxHost.State)resources.GetObject("axFlashTest.OcxState"); this.flashTestObject.Size = new System.Drawing.Size(34, 32); this.flashTestObject.TabIndex = 1; ((System.ComponentModel.ISupportInitialize)this.flashTestObject).EndInit(); try { this.dialogTop1.Controls.Add(this.flashTestObject); } catch (COMException) { this.dialogTop1.Controls.Remove(this.flashTestObject); throw; } }
public static void AddFlash(XmlElement el, System.Windows.Forms.Form f) { Point location = new Point(); Size size = new Size(); string src; try { if (!string.IsNullOrEmpty(el.GetAttribute("location"))) { location.X = int.Parse(el.GetAttribute("location").Split(';')[0]); location.Y = int.Parse(el.GetAttribute("location").Split(';')[1]); } if (!string.IsNullOrEmpty(el.GetAttribute("size"))) { size.Width = int.Parse(el.GetAttribute("size").Split(';')[0]); size.Height = int.Parse(el.GetAttribute("size").Split(';')[1]); } src = el.GetAttribute("src"); } catch (Exception ex) { HelperClass.CrashLog.AddCrash(new Exception("AddFlash::ERROR IN ARGUMENTS", ex)); return; } try { AxShockwaveFlashObjects.AxShockwaveFlash Flash = new AxShockwaveFlashObjects.AxShockwaveFlash(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(acceptaccount)); ((System.ComponentModel.ISupportInitialize)(Flash)).BeginInit(); f.SuspendLayout(); // // Flash // Flash.Enabled = true; Flash.Location = location; Flash.Name = "Flash"; Flash.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("Flash.OcxState"))); Flash.Size = new Size(size.Width, size.Height); //Flash.SetZoomRect(0, 0, 1280, 184); Flash.TabIndex = 0; f.Controls.Add(Flash); ((System.ComponentModel.ISupportInitialize)(Flash)).EndInit(); f.ResumeLayout(false); Flash.LoadMovie(0, System.IO.Directory.GetCurrentDirectory() + System.IO.Path.DirectorySeparatorChar + src); Flash.Play(); //Flash.ClientRectangle = new Rectangle(0, 0, 1280, 184); //Flash.ClientSize = size; //Flash.Dock = DockStyle.None; Flash.ScaleMode = 1; Flash.Size = new Size(size.Width, size.Height); //Flash.Pan(100, 100, 0); //Flash.Zoom(50); lFlash.Add(Flash); Ipaybox.Option["can-flash-initialize"] = "true"; } catch (Exception ex) { Ipaybox.Option["can-flash-initialize"] = "false"; HelperClass.CrashLog.AddCrash(new Exception("Невозможно инициализировать флэш ролик", ex)); } }
private bool loadFlash() { if (NetClass.ConnectionAvailable(flashFile)) { neoNowPlay = new AxShockwaveFlashObjects.AxShockwaveFlash(); neoNowPlay.Location = new Point(0, 0); this.Controls.Add(neoNowPlay); neoNowPlay.LoadMovie(0, flashFile); neoNowPlay.Size = new Size(300, 120); neoNowPlay.Play(); return true; } else { return false; } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(videovoiceControl)); this.axShockwaveFlash2 = new AxShockwaveFlashObjects.AxShockwaveFlash(); ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash2)).BeginInit(); this.SuspendLayout(); // // axShockwaveFlash2 // this.axShockwaveFlash2.Enabled = true; this.axShockwaveFlash2.Location = new System.Drawing.Point(0, 0); this.axShockwaveFlash2.Name = "axShockwaveFlash2"; this.axShockwaveFlash2.OcxState = ((System.Windows.Forms.AxHost.State)(resources.GetObject("axShockwaveFlash2.OcxState"))); this.axShockwaveFlash2.Size = new System.Drawing.Size(230, 200); this.axShockwaveFlash2.TabIndex = 2; this.axShockwaveFlash2.FSCommand += new AxShockwaveFlashObjects._IShockwaveFlashEvents_FSCommandEventHandler(this.axShockwaveFlash2_FSCommand); // // videovoiceControl // this.Controls.Add(this.axShockwaveFlash2); this.Name = "videovoiceControl"; this.Size = new System.Drawing.Size(231, 202); this.Load += new System.EventHandler(this.videovoiceControl_Load); ((System.ComponentModel.ISupportInitialize)(this.axShockwaveFlash2)).EndInit(); this.ResumeLayout(false); }
public void SearchAndAdd(ListOfFiles <FileStructure> fileList, bool getContents, string[] InludingExtensionList, string[] ExcludingExtensionList, DateTime startDate, DateTime endDate, int dateType = -1, int FileSizeType = -1, long fileSizeStart = -1, long fileSizeEnd = -1, bool lookForDate = false, AxShockwaveFlashObjects.AxShockwaveFlash flx = null) { //if (fileList == null || fileList.Count == 0) { // return; //} if (FileSizeType == FileSizeTypeStructure.KB) { fileSizeStart = fileSizeStart * (int)FileSizeTypeStructure.KB_1; fileSizeEnd = fileSizeEnd * (int)FileSizeTypeStructure.KB_1; } else if (FileSizeType == FileSizeTypeStructure.MB) { fileSizeStart = fileSizeStart * (int)FileSizeTypeStructure.MB_1; fileSizeEnd = fileSizeEnd * (int)FileSizeTypeStructure.MB_1; } else if (FileSizeType == FileSizeTypeStructure.GB) { fileSizeStart = fileSizeStart * (int)FileSizeTypeStructure.GB_1; fileSizeEnd = fileSizeEnd * (int)FileSizeTypeStructure.GB_1; } else { fileSizeStart = -1; fileSizeEnd = -1; } foreach (var filestr in fileList) { //new Thread(() => { var isExtensionExist = false; if (InludingExtensionList != null) { isExtensionExist = InludingExtensionList.Any(n => n == filestr.Extension); } var isDisableExtensionExist = false; if (ExcludingExtensionList != null) { isDisableExtensionExist = ExcludingExtensionList.Any(n => n == filestr.Extension); } bool addFile = false; bool isExtensionRight = false; bool isSizeRight = false; bool isDateRight = false; if (isExtensionExist && !isDisableExtensionExist) { isExtensionRight = true; } if (filestr.FileName == "Biology_2_2_2.txt") { string swe = filestr.FileName; } if (FileSizeType != FileSizeTypeStructure.NoLimit) { if (filestr.SizeBytes >= fileSizeStart && filestr.SizeBytes <= fileSizeEnd) { isSizeRight = true; //only if size meets the condition then add the file. } } else { isSizeRight = true; //no size limit } if (lookForDate) { if (dateType == DateTypeStructure.Modified_Date) { DateTime dt = filestr.ModifiedDate.Date; if (dt != null && (dt >= startDate.Date && dt <= endDate.Date)) { isDateRight = true; } } else if (dateType == DateTypeStructure.Created_Date) { DateTime dt = filestr.CreatedDate.Date; if (dt != null && (dt >= startDate.Date && dt <= endDate.Date)) { isDateRight = true; } } else if (dateType == DateTypeStructure.Access_Date) { DateTime dt = filestr.LastAccessDate.Date; if (dt != null && (dt >= startDate.Date && dt <= endDate.Date)) { isDateRight = true; } } } else { isDateRight = true; } if (isSizeRight && isDateRight && isExtensionRight) { addFile = true; } if (addFile) { new Thread(() => { if (folder.IsMatchInText(filestr.FileName, fileList)) { FlashPropertise.addListItemStatic(filestr.FileName, filestr.ExactLocation, flx); } else if (getContents && !filestr.IsContentEmpty && folder.IsMatchInText(filestr.Content, fileList)) { FlashPropertise.addListItemStatic(filestr.FileName, filestr.ExactLocation, flx); } else if (getContents && filestr.SizeBytes <= FileSizeTypeStructure.MB_1 * 3) { filestr.Content = folder.ReadFile(filestr.ExactLocation, filestr.SizeBytes); if (filestr.IsContentEmpty) { } fileList.IsSavingNecessary = true; } }).Start(); } //}).Start(); } }
public FlashHelper(string flashPath,AxShockwaveFlashObjects.AxShockwaveFlash flashContainer) { container=flashContainer; container.Movie = flashPath; }