本文整理汇总了C#中Framework.GetAvailableInternalStoragePlugins方法的典型用法代码示例。如果您正苦于以下问题:C# Framework.GetAvailableInternalStoragePlugins方法的具体用法?C# Framework.GetAvailableInternalStoragePlugins怎么用?C# Framework.GetAvailableInternalStoragePlugins使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Framework
的用法示例。
在下文中一共展示了Framework.GetAvailableInternalStoragePlugins方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FormSettingsTreeView
public FormSettingsTreeView(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin)
: this()
{
this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT);
this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE);
this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE);
this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY);
this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API);
this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP);
this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND);
this.checkBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTOSAVEONCLOSE);
this.button1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CLEARAUTHORIZE);
this.groupBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_OTHERACCOUNTNAMES);
this.listView1.Columns[0].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX);
this.listView1.Columns[1].Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME);
this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_CODEPREFIX);
this.label8.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_ACCOUNTNAME);
this.checkBox3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_SHOWOKAPIMENU);
TreeNode tn;
tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL));
tn.Tag = panelGeneral;
treeView1.Nodes.Add(tn);
foreach (var t in Enum.GetNames(typeof(Framework.PluginType)))
{
tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(PluginTypeToString(t)));
tn.Tag = (Framework.PluginType)Enum.Parse(typeof(Framework.PluginType), t);
treeView1.Nodes.Add(tn);
}
_core = core;
_ownerPlugin = ownerPlugin;
_pluginList = core.GetPlugins();
List<string> allPlugins = core.GetAllDetectedPlugins();
checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray());
foreach (Framework.Interfaces.IPlugin p in _pluginList)
{
int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName);
if (index >= 0)
{
checkedListBoxPlugins.SetItemChecked(index, true);
}
List<UserControl> pnls = p.CreateConfigurationPanels();
if (pnls != null && pnls.Count > 0)
{
_ucList.AddRange(pnls.ToArray());
int yPos = 0;
foreach (UserControl uc in pnls)
{
uc.Location = new Point(0, yPos);
yPos += uc.Height;
uc.Visible = false;
splitContainer1.Panel2.Controls.Add(uc);
}
foreach (TreeNode t in treeView1.Nodes)
{
if (t.Tag!=null && t.Tag.GetType()==typeof( Framework.PluginType))
{
if ((Framework.PluginType)t.Tag == p.PluginType)
{
tn = new TreeNode(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName));
tn.Tag = pnls;
t.Nodes.Add(tn);
break;
}
}
}
}
}
//delete the plugin nodes with no childs (settings)
int i = 1;
while ( i < treeView1.Nodes.Count)
{
TreeNode t = treeView1.Nodes[i];
if (t.Tag != null && t.Tag.GetType() == typeof(Framework.PluginType))
{
if (t.Nodes.Count == 0)
{
treeView1.Nodes.RemoveAt(i);
}
else
{
i++;
}
}
}
treeView1.ExpandAll();
treeView1.SelectedNode = treeView1.Nodes[0];
comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray());
comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin;
textBoxUsername.Text = core.GeocachingComAccount.AccountName;
labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES);
labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType;
checkBox1.Checked = core.LoadLogsInBackground;
//.........这里部分代码省略.........
示例2: FormSettings
public FormSettings(Framework.Interfaces.ICore core, Utils.BasePlugin.Plugin ownerPlugin)
: this()
{
this.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_TITLE);
this.tabPageGeneral.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GENERAL);
this.groupBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_GCCOMACCOUNT);
this.buttonAuthorize.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_AUTHORIZE);
this.groupBox2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_PLUGINS);
this.buttonApply.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_APPLY);
this.label1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_NAME);
this.label2.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_API);
this.label3.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_MENBERSHIP);
this.label7.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_INTERNALSTORAGE);
this.checkBox1.Text = Utils.LanguageSupport.Instance.GetTranslation(STR_LOADINBACKGROUND);
_core = core;
_ownerPlugin = ownerPlugin;
_pluginList = core.GetPlugins();
List<string> allPlugins = core.GetAllDetectedPlugins();
checkedListBoxPlugins.Items.AddRange(allPlugins.ToArray());
foreach (Framework.Interfaces.IPlugin p in _pluginList)
{
int index = checkedListBoxPlugins.Items.IndexOf(p.GetType().FullName);
if (index >= 0)
{
checkedListBoxPlugins.SetItemChecked(index, true);
}
List<UserControl> pnls = p.CreateConfigurationPanels();
if (pnls != null && pnls.Count > 0)
{
_ucList.AddRange(pnls.ToArray());
//create tab
TabPage tp = new TabPage(Utils.LanguageSupport.Instance.GetTranslation(p.FriendlyName));
tp.AutoScroll = true;
tabControlSettings.TabPages.Add(tp);
//add controls
FlowLayoutPanel fp = new FlowLayoutPanel();
tp.Controls.Add(fp);
fp.Dock = DockStyle.Fill;
fp.Controls.AddRange(pnls.ToArray());
}
}
comboBoxInternalStorage.Items.AddRange(core.GetAvailableInternalStoragePlugins().ToArray());
comboBoxInternalStorage.SelectedItem = core.ActiveInternalStoragePlugin;
textBoxUsername.Text = core.GeocachingComAccount.AccountName;
labelApiEnabled.Text = string.IsNullOrEmpty(core.GeocachingComAccount.APIToken) ? Utils.LanguageSupport.Instance.GetTranslation(STR_NO) : Utils.LanguageSupport.Instance.GetTranslation(STR_YES);
labelApiMembership.Text = string.IsNullOrEmpty(core.GeocachingComAccount.MemberType) ? "-" : core.GeocachingComAccount.MemberType;
checkBox1.Checked = core.LoadLogsInBackground;
}