本文整理汇总了C#中IMainForm类的典型用法代码示例。如果您正苦于以下问题:C# IMainForm类的具体用法?C# IMainForm怎么用?C# IMainForm使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IMainForm类属于命名空间,在下文中一共展示了IMainForm类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadPlugin
public static void LoadPlugin(string FileName, IMainForm Parent, bool ShowError)
{
try
{
Assembly pluginAssembly = Assembly.LoadFrom(FileName);
Type[] types = pluginAssembly.GetTypes();
foreach (Type type in types)
{
if (type.Name.Equals("Plugin"))
{
IPlugin inst = (IPlugin)pluginAssembly.CreateInstance(type.FullName);
PluginType add = new PluginType(inst.Name, FileName, inst.Version);
if (!Plugins.Contains(add))
{
Plugins.Add(add);
inst.Initialize(Parent);
Parent.LoadPlugin(inst);
}
else if (ShowError) MessageBox.Show("This plugin is already loaded!", "Error");
pluginAssembly = null;
inst = null;
add = null;
return;
}
}
if (ShowError) MessageBox.Show("This is not valid plugin!", "Error");
}
catch (Exception ex)
{
if (ShowError) MessageBox.Show(ex.Message, "Error");
}
}
示例2: RichToolTip
public RichToolTip(IMainForm mainForm)
{
// panel
toolTip = new Panel();
toolTip.Location = new System.Drawing.Point(0,0);
toolTip.BackColor = System.Drawing.SystemColors.Info;
toolTip.ForeColor = System.Drawing.SystemColors.InfoText;
toolTip.BorderStyle = BorderStyle.FixedSingle;
toolTip.Visible = false;
(mainForm as Form).Controls.Add(toolTip);
// text
toolTipRTB = new System.Windows.Forms.RichTextBox();
toolTipRTB.Location = new System.Drawing.Point(2,1);
toolTipRTB.BackColor = System.Drawing.SystemColors.Info;
toolTipRTB.ForeColor = System.Drawing.SystemColors.InfoText;
toolTipRTB.BorderStyle = BorderStyle.None;
toolTipRTB.ScrollBars = RichTextBoxScrollBars.None;
toolTipRTB.DetectUrls = false;
toolTipRTB.ReadOnly = true;
toolTipRTB.WordWrap = false;
toolTipRTB.Visible = true;
toolTipRTB.Text = "";
toolTip.Controls.Add(toolTipRTB);
// rtf cache
rtfCache = new Dictionary<String, String>();
rtfCacheList = new List<String>();
}
示例3: PublicResultForm
public PublicResultForm(QueryResult resultSet, MainForm owner)
{
InitializeComponent();
FormsConn fc = new FormsConn(resultSet);
imainForm = (IMainForm)fc;
m_mainForm = owner;
}
示例4: LoadLanguage
public static void LoadLanguage(string aName, IMainForm parent, bool ShowError)
{
if (aName == "English")
{
Language = new LanguageBase();
Settings.Settings.Language = "English";
parent.ChangeLanguage();
return;
}
try
{
Assembly pluginAssembly = Assembly.LoadFrom(Path + "\\Languages\\" + aName + ".dll");
Type[] types = pluginAssembly.GetTypes();
foreach (Type type in types)
{
if (type.Name.Equals("Language"))
{
Language = (LanguageBase)pluginAssembly.CreateInstance(type.FullName);
}
}
pluginAssembly = null;
}
catch (FileNotFoundException ex)
{
if (ShowError) MessageBox.Show(ex.Message, "Error");
Language = new LanguageBase();
Settings.Settings.Language = "English";
parent.ChangeLanguage();
return;
}
Settings.Settings.Language = aName;
parent.ChangeLanguage();
}
示例5: MainFormController
public MainFormController(IMainForm mainForm)
{
MainForm = mainForm;
EngineCache = new EngineCache();
LoadSettings();
}
示例6: MainFormPresenter
public MainFormPresenter(IMainForm view)
{
_view = view;
view.NewPlanClick += (s, e) => OnNewPlanClick();
view.OpenPlanClick += (s, e) => OnOpenPlanClick();
view.OpenSpecificPlanClick += (s, e) => LoadTrainingPlan(e);
view.ClosePlanClick += (s, e) => OnClosePlanClick();
view.AddWorkoutClick += (s, e) => OnAddWorkoutClick();
view.EditWorkoutClick += (s, e) => OnEditWorkoutClick(e);
view.DeleteWorkoutClick += (s, e) => OnDeleteWorkoutClick(e);
view.ManageWorkoutsClick += (s, e) => OnManageWorkoutsClick();
view.AddWorkoutCategoryClick += (s, e) => OnAddWorkoutCategoryClick();
view.EditWorkoutCategoryClick += (s, e) => OnEditWorkoutCategoryClick(e);
view.DeleteWorkoutCategoryClick += (s, e) => OnDeleteWorkoutCategoryClick(e);
view.ManageWorkoutCategoriesClick += (s, e) => OnManageWorkoutCategoriesClick();
view.ConfigurePacesClick += (s, e) => OnConfigurePacesClick();
view.InfoClick += (s, e) => OnInfoClick();
view.WeeklyPlanChanged += (s, e) => Data.UpdateTrainingPlan(e.Value);
// automatically load last plan on startup
var recentPlans = Misc.Default.LastTrainingPlans.Split(';');
if (recentPlans.Length <= 0)
{
return;
}
LoadTrainingPlan(recentPlans[0]);
}
示例7: Initialize
/// <summary>
/// Activates if the sender is MainForm
/// </summary>
public static void Initialize(IMainForm sender)
{
if (sender.GetType().ToString() == "FlashDevelop.MainForm")
{
instance = sender;
}
}
示例8: FDMenus
public FDMenus(IMainForm mainForm)
{
// modify the view menu
CommandBarMenu viewMenu = mainForm.GetCBMenu("ViewMenu");
View = new CommandBarButton("&Project Explorer");
View.Image = Icons.Project.Img;
viewMenu.Items.Add(View);
// modify the tools menu - add a nice GUI classpath editor
GlobalClasspaths = new CommandBarButton("&Global Classpaths...");
GlobalClasspaths.Shortcut = Keys.F9 | Keys.Control;
mainForm.IgnoredKeys.Add(GlobalClasspaths.Shortcut);
CommandBarMenu toolsMenu = mainForm.GetCBMenu("ToolsMenu");
toolsMenu.Items.AddSeparator();
toolsMenu.Items.Add(GlobalClasspaths);
ProjectMenu = new ProjectMenu();
CommandBar mainMenu = mainForm.GetCBMainMenu();
mainMenu.Items.Insert(5, ProjectMenu);
RecentComboBox = RecentComboBox.Create();
CommandBar toolBar = mainForm.GetCBToolbar();
if (toolBar != null) // you might have turned off the toolbar
{
toolBar.Items.AddSeparator();
toolBar.Items.Add(ProjectMenu.TestMovie);
toolBar.Items.Add(RecentComboBox);
}
}
示例9: XnaGame
public XnaGame( IMainForm mainForm )
{
_mainForm = mainForm ;
_drawSurface = _mainForm.GetHandle( ) ;
Logger.Instance.log("Game1 creation started.");
_graphics = new GraphicsDeviceManager( this )
{
PreferredBackBufferWidth = 800,
PreferredBackBufferHeight = 600
} ;
Content.RootDirectory = "Content";
_graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
_winform = (Form)Form.FromHandle(Window.Handle);
_winform.VisibleChanged += game1VisibleChanged;
_winform.Size = new Size(10, 10);
Mouse.WindowHandle = _drawSurface;
Size pictureBoxSize = _mainForm.CanvasSize ;
ResizeBackBuffer( pictureBoxSize.Width, pictureBoxSize.Height ) ;
_winform.Hide();
}
示例10: RichToolTip
public RichToolTip(IMainForm mainForm)
{
EventManager.AddEventHandler(this, EventType.ApplyTheme);
// panel
toolTip = new Panel();
toolTip.Location = new Point(0,0);
toolTip.BackColor = SystemColors.Info;
toolTip.ForeColor = SystemColors.InfoText;
toolTip.BorderStyle = BorderStyle.FixedSingle;
toolTip.Visible = false;
(mainForm as Form).Controls.Add(toolTip);
// text
toolTipRTB = new RichTextBox();
toolTipRTB.Font = PluginBase.Settings.DefaultFont;
toolTipRTB.BackColor = SystemColors.Info;
toolTipRTB.ForeColor = SystemColors.InfoText;
toolTipRTB.BorderStyle = BorderStyle.None;
toolTipRTB.ScrollBars = RichTextBoxScrollBars.None;
toolTipRTB.DetectUrls = false;
toolTipRTB.ReadOnly = true;
toolTipRTB.WordWrap = false;
toolTipRTB.Visible = true;
toolTipRTB.Text = "";
toolTip.Controls.Add(toolTipRTB);
// rtf cache
rtfCache = new Dictionary<String, String>();
rtfCacheList = new List<String>();
}
示例11: Browser
public Browser(IMainForm aParent, string url)
{
parent = aParent;
InitializeComponent();
AfterInit();
webBrowser1.Navigate(url);
}
示例12: DocumentPage
public DocumentPage(IMainForm main_form, string fileExtension)
{
InitializeComponent();
MainForm = main_form;
Text = "NewFile";
CreateTextBox(fileExtension);
//this.ImageIndex = 0;
}
示例13: Download
public Download (IMainForm mainForm, IStorage store)
{
this.MainForm = mainForm;
this.Storage = store;
}
示例14: SpentInDiffDaysView
public SpentInDiffDaysView(IHistoryDataProvider historyDataProvider, IMainForm mainForm)
{
this.historyDataProvider = historyDataProvider;
this.mainForm = mainForm;
InitializeComponent();
if(historyDataProvider!=null)
this.daySpentDataGrid.DataSource = this.historyDataProvider.Data;
}
示例15: Storage
public Storage(IMainForm mainForm, IValidation valid)
{
this.IMainForm = mainForm;
this.Validation = valid;
}