本文整理汇总了C#中Framework类的典型用法代码示例。如果您正苦于以下问题:C# Framework类的具体用法?C# Framework怎么用?C# Framework使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Framework类属于命名空间,在下文中一共展示了Framework类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public override bool Initialize(Framework.Interfaces.ICore core)
{
AddAction(ACTION_SHOW);
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_ADDTOSELECTION));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_ALL));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_AREA));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_CITY));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_COUNTRY));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_LEVEL));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_MUNICIPALITY));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_NEWSEARCH));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_OTHER));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_PREFIX));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_REGIONSELECTION));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_SEARCHING));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_SEARCHWITHINSELECTION));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_SELECT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_SELECTIONOPTIONS));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_STATE));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_TITLE));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SelectRegionForm.STR_INENVELOPE));
return base.Initialize(core);
}
示例2: Initialize
public override bool Initialize(Framework.Interfaces.ICore core)
{
AddAction(ACTION_EXPORT_ALL);
AddAction(ACTION_EXPORT_SELECTED);
if (Properties.Settings.Default.UpgradeNeeded)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.UpgradeNeeded = false;
Properties.Settings.Default.Save();
}
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_NOGEOCACHESELECTED));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_EXPORTINGGPX));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_CREATINGFILE));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SAVING));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SAVINGDATA));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_SAVINGGEOCACHES));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MAXLOGS));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_GRABBEDIMG));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MAXFILESINFOLDER));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsPanel.STR_MAXFILESINFOLDERNULL));
return base.Initialize(core);
}
示例3: Build
private void Build(Framework.Parts.IActor actor)
{
displayProperties = new Utility.PropertyTable();
Proteus.Framework.Parts.IProperty[] properties = currentActor.Properties;
foreach (Proteus.Framework.Parts.IProperty p in properties)
{
// Now set it.
TypeConverter converter = TypeDescriptor.GetConverter( p.Type );
Type editorType = p.EditorType;
Utility.PropertySpec spec = null;
if (converter != null && editorType != null)
{
spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue,editorType,converter.GetType() );
}
else
{
spec = new Utility.PropertySpec(p.Name, p.Type, p.Category, p.Description, p.DefaultValue);
}
// Store it.
displayProperties.Properties.Add( spec );
displayProperties[ p.Name ] = p.CurrentValue;
}
propertyGrid1.SelectedObject = displayProperties;
displayProperties.SetValue += new Proteus.Editor.Utility.PropertySpecEventHandler(displayProperties_SetValue);
}
示例4: Logs_LogRemoved
void Logs_LogRemoved(object sender, Framework.EventArguments.LogEventArgs e)
{
if (this.Visible)
{
UpdateView(true);
}
}
示例5: InitializeAsync
public async override Task<bool> InitializeAsync(Framework.Interfaces.ICore core)
{
var p = new PluginSettings(core);
AddAction(ACTION_ADD_ALL);
AddAction(ACTION_ADD_SELECTED);
AddAction(ACTION_ADD_ACTIVE);
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_NOGEOCACHESELECTED));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_ADDONETOCAL));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_ADDTO));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_ADDTOCAL));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_BY));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_DESCRIPTION));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_DESCRIPTIONB));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_END));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_EVENT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_GEOCACHEEVENT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_GOOGLEXPL));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_LOCATION));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_SAVE));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_START));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_SUMMARY));
core.LanguageItems.Add(new Framework.Data.LanguageItem(AddToCalendarForm.STR_TITLE));
return await base.InitializeAsync(core);
}
示例6: Geocaches_SelectedChanged
void Geocaches_SelectedChanged(object sender, Framework.EventArguments.GeocacheEventArgs e)
{
if (Visible)
{
checkButtons();
}
}
示例7: RunTests
public static List<TestResult> RunTests(int runID, Framework framework, ITestSignature testSignature)
{
List<TestResult> results = new List<TestResult>();
TestResult result = new TestResult() { Run = runID, Framework = framework };
List<long> playerByIDResults = new List<long>();
for (int i = 1; i <= NumPlayers; i++)
{
playerByIDResults.Add(testSignature.GetPlayerByID(i));
}
result.PlayerByIDMilliseconds = Math.Round(playerByIDResults.Average(), 2);
List<long> playersForTeamResults = new List<long>();
for (int i = 1; i <= NumTeams; i++)
{
playersForTeamResults.Add(testSignature.GetPlayersForTeam(i));
}
result.PlayersForTeamMilliseconds = Math.Round(playersForTeamResults.Average(), 2);
List<long> teamsForSportResults = new List<long>();
for (int i = 1; i <= NumSports; i++)
{
teamsForSportResults.Add(testSignature.GetTeamsForSport(i));
}
result.TeamsForSportMilliseconds = Math.Round(teamsForSportResults.Average(), 2);
results.Add(result);
return results;
}
示例8: AttachementsForm
public AttachementsForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
: base(owner, core)
{
InitializeComponent();
if (Properties.Settings.Default.UpgradeNeeded)
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.UpgradeNeeded = false;
Properties.Settings.Default.Save();
}
if (Properties.Settings.Default.WindowPos != null && !Properties.Settings.Default.WindowPos.IsEmpty)
{
this.Bounds = Properties.Settings.Default.WindowPos;
this.StartPosition = FormStartPosition.Manual;
}
try
{
_databaseFile = System.IO.Path.Combine(core.PluginDataPath, "attachements.db3" );
}
catch
{
}
SelectedLanguageChanged(this, EventArgs.Empty);
core.ActiveGeocacheChanged += new Framework.EventArguments.GeocacheEventHandler(core_ActiveGeocacheChanged);
}
示例9: core_ActiveGeocacheChanged
void core_ActiveGeocacheChanged(object sender, Framework.EventArguments.GeocacheEventArgs e)
{
if (this.Visible)
{
UpdateView();
}
}
示例10: Initialize
public override bool Initialize(Framework.Interfaces.ICore core)
{
bool result = false;
_customDictionaryDatabaseFile = System.IO.Path.Combine(core.PluginDataPath, "LanguageEng.db3" );
if (base.Initialize(core))
{
LanguageInfo li = new LanguageInfo();
li.Action = "English";
li.CultureInfo = new System.Globalization.CultureInfo(1033); //en-US
li.Action = li.CultureInfo.NativeName;
SupportedLanguages.Add(li);
try
{
string fld = System.IO.Path.GetDirectoryName(_customDictionaryDatabaseFile);
if (!System.IO.Directory.Exists(fld))
{
System.IO.Directory.CreateDirectory(fld);
}
}
catch
{
}
initDatabase();
result = true;
}
return result;
}
示例11: Geocaches_DataChanged
void Geocaches_DataChanged(object sender, Framework.EventArguments.GeocacheEventArgs e)
{
if (this.Visible && _mapUpdated)
{
UpdateMap();
}
}
示例12: InitializeAsync
public async override Task<bool> InitializeAsync(Framework.Interfaces.ICore core)
{
if (PluginSettings.Instance == null)
{
var p = new PluginSettings(core);
}
AddAction(ACTION_SHOW);
AddAction(ACTION_SEP);
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ERROR));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_ASKSAVEDATA));
core.LanguageItems.Add(new Framework.Data.LanguageItem(STR_WARNING));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_AVAILABLE));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_COPYCURRENT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_COPYDEFAULT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_CURRENT));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_ENABLESTARTUP));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_FOLDER));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_OK));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_SETTINGSFOLDER));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_SWITCH));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_TARGETSETTINGSFOLDER));
core.LanguageItems.Add(new Framework.Data.LanguageItem(SettingsFolderForm.STR_TITLE));
return await base.InitializeAsync(core);
}
示例13: SetupWizardForm
public SetupWizardForm(Framework.Interfaces.IPlugin owner, Framework.Interfaces.ICore core)
{
InitializeComponent();
this.TopMost = true;
_ownerPlugin = owner as SetupWizard;
_core = core;
UpdateTextForLanguage();
textBoxAccountname.Text = core.GeocachingComAccount.AccountName;
textBoxHomecoords.Text = Utils.Conversion.GetCoordinatesPresentation(core.HomeLocation);
textBoxCentercoords.Text = Utils.Conversion.GetCoordinatesPresentation(core.CenterLocation);
comboBoxLanguage.Items.Add(Utils.LanguageSupport.Instance.GetTranslation(STR_ORGTEXT));
comboBoxLanguage.Items.AddRange(Utils.LanguageSupport.Instance.GetSupportedCultures().ToArray());
for (int i = 1; i < comboBoxLanguage.Items.Count; i++)
{
if ((comboBoxLanguage.Items[i] as System.Globalization.CultureInfo).LCID == core.SelectedLanguage.LCID)
{
comboBoxLanguage.SelectedIndex = i;
break;
}
}
if (comboBoxLanguage.SelectedIndex < 0)
{
comboBoxLanguage.SelectedIndex = 0;
}
}
示例14: GetList
public System.Collections.Generic.IEnumerable<TNS.Db.Person> GetList(Framework.Core.Model.PageInfo pageInfo)
{
//创建一个MySqlCommand对象
MySqlCommand cmd = new MySqlCommand();
try
{
int startPageIndex = pageInfo.PageIndex * pageInfo.PageSize;
int endPageIndex = (pageInfo.PageIndex + 1) * pageInfo.PageSize;
string sql = string.Format(@"SELECT personId,firstName,secondName,comments FROM Person LIMIT {0} , {1} ", startPageIndex, endPageIndex);
//调用 PrepareCommand 方法,对 MySqlCommand 对象设置参数
MySqlHelper.PrepareCommand(cmd, null, CommandType.Text, sql, null);
//调用 MySqlCommand 的 ExecuteReader 方法
MySqlDataAdapter adapter = new MySqlDataAdapter();
adapter.SelectCommand = cmd;
DataSet ds = new DataSet();
adapter.Fill(ds);
return TNS.Db.Util.ConvertHelper.DataSetToEntityList<Person>(ds, 0);
}
catch (Exception e)
{
MySqlHelper.CloseDBConnection();
throw e;
}
finally
{
//清除参数
cmd.Parameters.Clear();
}
}
示例15: Initialize
public void Initialize(Framework.Initialization.InitializationEngine context)
{
if (_initialized || PageReference.IsNullOrEmpty(GlobalNewsContainer) || context.HostType != HostType.WebApplication )
{
return;
}
var providerManager = ServiceLocator.Current.GetInstance<IContentProviderManager>();
var startPages = DataFactory.Instance.GetChildren(PageReference.RootPage).OfType<StartPage>();
// Attach content provider to each site's global news container
foreach (var startPage in startPages.Where(startPage => !PageReference.IsNullOrEmpty(startPage.GlobalNewsPageLink)))
{
try
{
_logger.DebugFormat("Attaching global news content provider to page {0} [{1}], global news will be retrieved from page {2} [{3}]",
startPage.GlobalNewsPageLink.GetPage().Name,
startPage.GlobalNewsPageLink.ID,
GlobalNewsContainer.GetPage().PageName,
GlobalNewsContainer.ID);
var provider = new ClonedContentProvider(GlobalNewsContainer, startPage.GlobalNewsPageLink, startPage.Category);
providerManager.ProviderMap.AddProvider(provider);
}
catch (Exception ex)
{
_logger.ErrorFormat("Unable to create global news content provider for start page with ID {0}: {1}", startPage.PageLink.ID, ex.Message);
}
}
_initialized = true;
}
开发者ID:kmorcinek,项目名称:EPiServer7-alloy-template-web-forms,代码行数:34,代码来源:GlobalNewsContentProviderInitialization.cs