private void CreateNativeProcess() { this.Process = ProcessCreator.CreateProcess(ApplicationString); Application.Current.Exit += (x, y) => Process.Kill(); Process.EnableRaisingEvents = true; Process.Exited += Process_Exited; Thread.Sleep(100); //BAD, need a better way to wait for signal //Gets the current window style, removes the border from it (~0x00450000) ExternalFunctions.SetWindowLong(Process.MainWindowHandle, -16, (int)(ExternalFunctions.GetWindowLong(Process.MainWindowHandle, -16) & ~0x00450000)); System.Windows.Forms.ContainerControl panel1 = new System.Windows.Forms.ContainerControl(); IntPtr value = ExternalFunctions.SetParent(Process.MainWindowHandle, panel1.Handle); this.Window = Process.MainWindowHandle; //HookNativeKeyboardEvent(); this.Content = new System.Windows.Forms.Integration.WindowsFormsHost() { Child = panel1 }; }
void ITranslator.Restoration(System.Windows.Forms.ContainerControl containerControl) { foreach (System.Windows.Forms.Control control in containerControl.Controls) { ((ITranslator)this).Restoration(control); } }
void ITranslator.Restoration(System.Windows.Forms.ContainerControl containerControl) { if (this.translator != null) { this.translator.Restoration(containerControl); } }
void ITranslator.Translate(System.Windows.Forms.ContainerControl containerControl, string sourceCultureName, string targetCultureName) { if (this.translator != null) { ((ITranslator)this).Translate(containerControl, sourceCultureName, targetCultureName); } }
void ITranslator.Translate(System.Windows.Forms.ContainerControl containerControl, CultureInfo sourceCultureInfo, CultureInfo targetCultureInfo) { if (this.translator != null) { ((ITranslator)this).Translate(containerControl, sourceCultureInfo.Name, targetCultureInfo.Name); } }
public void EndEditToDataBinding(System.Windows.Forms.ContainerControl mainControl) { foreach (System.Windows.Forms.Binding binding in DataBindings) { binding.WriteValue(); } }
void ITranslator.Translate(System.Windows.Forms.ContainerControl containerControl, string sourceCultureName, string targetCultureName) { foreach (System.Windows.Forms.Control control in containerControl.Controls) { ((ITranslator)this).Translate(control, sourceCultureName, targetCultureName); } }
private void TranslateControl(string parentName, System.Windows.Forms.ContainerControl control) { var name = parentName + "." + control.Name; var originalText = control.Text; if (!string.IsNullOrEmpty(originalText)) { control.Text = Translate(name); } }
/// <summary> /// 本来は指定したオブジェクトを初期化する為のメソッドですが、 /// この属性は (初めから初期化してある) シングルトンに対する物なので、 /// list を取得して Changed イベントにフックするだけです。 /// </summary> /// <param name="obj"> /// 指定しても意味はありません。 /// (形式的には SettingTreePanel.inst が指定されるべきです) /// </param> protected internal override void Initialize(System.Windows.Forms.ContainerControl obj) { if (this.initialized) { System.Console.Error.WriteLine(ERROR_DOUBLE_INIT); return; } this.initialized = true; this.list = SettingTreePanel.list; SettingTreePanel.Changed += new afh.EventHandler <object>(this.SettingTreePanel_Changed); }
/*************************************/ public static void Open(System.Windows.Forms.ContainerControl container, SearchConfig config = null) { if (m_SearchMenu == null) { return; } m_SearchMenu.SetParent(container); ShowWithConstraint(config); }
public void TranslateForm(System.Windows.Forms.ContainerControl container) { var name = container.Name; var originalText = container.Text; if (!string.IsNullOrEmpty(originalText)) { container.Text = Translate(name); } TranslateControl(container); }
/// <summary> /// ContainerControlTreeNode のコンストラクタ。 /// </summary> /// <param name="name">TreeNode に表示する文字列を指定して下さい。</param> /// <param name="t"> /// 関連付けるコンテナコントロールの型を指定して下さい。 /// 型は System.Windows.Forms.ContainerControl を継承し、 /// 亦、既定の public コンストラクタを持っていなければ為りません。 /// </param> public ContainerControlTreeNode(string name, System.Type t) : base(name) { if (!t.IsSubclassOf(typeof(System.Windows.Forms.ContainerControl))) { throw new System.ArgumentException("System.Windows.Forms.ContainerControl を継承する型を指定して下さい", "t"); } System.Reflection.ConstructorInfo ctor = t.GetConstructor(new System.Type[] {}); if (ctor == null) { throw new System.ArgumentException("指定した System.Type は既定の public コンストラクタを持ちません。", "t"); } this.ctrl = (System.Windows.Forms.ContainerControl)ctor.Invoke(new object[] {}); this.initialize_ctrl(); }
/*************************************/ public static bool Activate(System.Windows.Forms.ContainerControl container) { if (m_SearchMenu == null) { m_SearchMenu = new SearchMenu_WinForm(); m_SearchMenu.ItemSelected += M_SearchMenu_ItemSelected; m_SearchMenu.Disposed += M_SearchMenu_Disposed; m_PossibleItems = m_SearchMenu.PossibleItems; } container.KeyDown += (sender, e) => { if (e.KeyCode == System.Windows.Forms.Keys.B && (Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift)) && (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))) { Open(container); } }; return(true); }
private static void SetMemoTextBoxParent(WinTextBox memoTextBox, GridControl gridControl) { if (gridControl != null) { System.Windows.Forms.ContainerControl viewerContainer = typeof(Xceed.Grid.GridControl).InvokeMember("ViewerContainer", BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, gridControl, null) as System.Windows.Forms.ContainerControl; if (viewerContainer == null) { viewerContainer = new System.Windows.Forms.ContainerControl { Size = new Size(0, 0), TabStop = false }; typeof(Xceed.Grid.GridControl).InvokeMember("ViewerContainer", System.Reflection.BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic, null, gridControl, new object[] { viewerContainer }, null, null, null); } memoTextBox.Parent = viewerContainer; } }
public static void ValidateControls(System.Windows.Forms.ContainerControl Form) { }
public void EndEditToDataBinding(System.Windows.Forms.ContainerControl mainControl) { mainControl.ActiveControl = null; }
//=========================================================== // .ctor //=========================================================== /// <summary> /// ContainerControlTreeNode のコンストラクタ。 /// </summary> /// <param name="name">TreeNode に表示する文字列を指定して下さい。</param> /// <param name="ctrl"> /// TreeNode に関連付けるコンテナコントロールを指定して下さい。 /// SettingContainerControl.Initialize による初期化は行っていない状態で指定して下さい。 /// </param> public ContainerControlTreeNode(string name, System.Windows.Forms.ContainerControl ctrl) : base(name) { this.ctrl = ctrl; this.initialize_ctrl(); }
public ErrorProvider(System.Windows.Forms.ContainerControl parentControl) : this() { this.parentControl = parentControl; this.propChangedEvent = new EventHandler(this.ParentControl_BindingContextChanged); parentControl.BindingContextChanged += this.propChangedEvent; }
void ITranslator.Translate(System.Windows.Forms.ContainerControl containerControl, System.Globalization.CultureInfo sourceCultureInfo, System.Globalization.CultureInfo targetCultureInfo) { ((ITranslator)this).Translate(containerControl, sourceCultureInfo.Name, targetCultureInfo.Name); }
void ITranslator.Translate(System.Windows.Forms.ContainerControl containerControl) { ((ITranslator)this).Translate(containerControl, ((ITranslator)this).SourceCultureName, ((ITranslator)this).TargetCultureName); }