本文整理汇总了C#中Toolkit类的典型用法代码示例。如果您正苦于以下问题:C# Toolkit类的具体用法?C# Toolkit怎么用?C# Toolkit使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Toolkit类属于命名空间,在下文中一共展示了Toolkit类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Initialize
public override void Initialize(TehModAPI api)
{
toolkit = Toolkit.GetToolkit();
api.RegisterMenu(this, "Add World Features");
api.AddOption(this, "Add Snow Biome", "addSnow", 2);
api.AddOption(this, "Convert Dirt to Snow", "convertSnow", 2);
api.AddOption(this, "Convert World to Snow", "convertWorldSnow", 2);
api.AddOption(this, "Add Dungeon", "addDungeon", 2);
api.AddOption(this, "Add Hell House", "addHell", 2);
api.AddOption(this, "Add Floating Island", "addIsland", 2);
api.AddOption(this, "Add Floating Island House", "addIslandHouse", 2);
api.AddOption(this, "Add Mine House", "addMineHouse", 2);
api.AddOption(this, "Start Hardmode", "startHm", 2);
api.AddOption(this, "Start Hardmode (No Biome Changes)", "startHm2", 2);
api.AddOption(this, "Stop Hardmode", "stopHm", 2);
api.AddOption(this, "Convert Corruption to Hallow", "convertCorruption", 2);
api.AddOption(this, "Convert Corruption to Normal", "convertCorruptionNormal", 2);
api.AddOption(this, "Convert Hallow to Corruption", "convertHallow", 2);
api.AddOption(this, "Convert Hallow to Normal", "convertHallowNormal", 2);
api.AddOption(this, "Start Goblin Invasion", "startGoblin", 2);
api.AddOption(this, "Start Frost Legion Invasion", "startFrost", 2);
api.AddOption(this, "Stop Invasion", "stopInvade", 2);
api.AddOption(this, "Christmas", "xMas", 0);
api.AddOption(this, "Quit Without Saving World", "exitNoSave", 2);
}
开发者ID:k0rd,项目名称:TerrariaPlugins,代码行数:25,代码来源:AddWorldFeatures.cs
示例2: MainForm
public MainForm()
{
InitializeComponent();
_toolkit = new Toolkit(new LambdaLogger(LogToListBox));
_sessionSaver = new IsolatedStorageProvider<MainFormSettings>();
}
开发者ID:anton-iermolenko,项目名称:Photo-library-toolkit,代码行数:7,代码来源:MainForm.cs
示例3: InitForToolkit
internal void InitForToolkit (Toolkit tk)
{
if (ToolkitEngine != tk) {
// Gather existing font property before switching handler
var fname = Family;
var size = Size;
var style = Style;
var weight = Weight;
var stretch = Stretch;
var oldHandler = ToolkitEngine.FontBackendHandler;
ToolkitEngine = tk;
handler = tk.FontBackendHandler;
if (fname == oldHandler.SystemFont.Family)
Backend = handler.WithSettings (handler.SystemFont.Backend, size, style, weight, stretch);
else if (fname == oldHandler.SystemMonospaceFont.Family)
Backend = handler.WithSettings (handler.SystemMonospaceFont.Backend, size, style, weight, stretch);
else if (fname == oldHandler.SystemSansSerifFont.Family)
Backend = handler.WithSettings (handler.SystemSansSerifFont.Backend, size, style, weight, stretch);
else if (fname == oldHandler.SystemSerifFont.Family)
Backend = handler.WithSettings (handler.SystemSerifFont.Backend, size, style, weight, stretch);
else {
var fb = handler.Create (fname, size, style, weight, stretch);
Backend = fb ?? handler.WithSettings(handler.GetSystemDefaultFont (), size, style, weight, stretch);
}
}
}
开发者ID:TheBrainTech,项目名称:xwt,代码行数:27,代码来源:Font.cs
示例4: TextLayout
internal TextLayout(Toolkit tk)
{
ToolkitEngine = tk;
handler = ToolkitEngine.TextLayoutBackendHandler;
Backend = handler.Create ();
Setup ();
}
开发者ID:Gaushick,项目名称:xwt,代码行数:7,代码来源:TextLayout.cs
示例5: Font
internal Font (object backend, Toolkit toolkit)
{
if (toolkit != null)
ToolkitEngine = toolkit;
handler = ToolkitEngine.FontBackendHandler;
if (backend == null)
throw new ArgumentNullException ("backend");
Backend = backend;
}
开发者ID:TheBrainTech,项目名称:xwt,代码行数:9,代码来源:Font.cs
示例6: Context
internal Context(object backend, Toolkit toolkit, ContextBackendHandler handler, bool getGlobalStyles = true)
: base(backend, toolkit, handler)
{
this.handler = handler;
if (getGlobalStyles) {
styles = globalStyles;
if (styles != StyleSet.Empty)
handler.SetStyles (Backend, styles);
}
}
开发者ID:akrisiun,项目名称:xwt,代码行数:10,代码来源:Context.cs
示例7: Draw
void Draw(object ctx, Rectangle bounds, ImageDescription idesc, Toolkit toolkit)
{
var c = new Context (ctx, toolkit);
if (idesc.Styles != StyleSet.Empty)
c.SetStyles (idesc.Styles);
c.Reset (null);
c.Save ();
c.GlobalAlpha = idesc.Alpha;
OnDraw (c, bounds);
c.Restore ();
}
开发者ID:akrisiun,项目名称:xwt,代码行数:11,代码来源:DrawingImage.cs
示例8: InitForToolkit
public void InitForToolkit (Toolkit t)
{
if (ToolkitEngine != t) {
var handler = t.GradientBackendHandler;
var backend = CreateGradientBackend (handler);
SetBackend (handler, backend);
if (stops != null)
foreach (var stop in stops)
handler.AddColorStop (backend, stop.Key, stop.Value);
}
}
开发者ID:m13253,项目名称:xwt,代码行数:11,代码来源:Gradient.cs
示例9: Initialize
public static void Initialize (string backendType)
{
if (engine != null)
return;
toolkit = Toolkit.Load (backendType, false);
toolkit.SetActive ();
engine = toolkit.Backend;
mainLoop = new UILoop (toolkit);
UIThread = System.Threading.Thread.CurrentThread;
toolkit.EnterUserCode ();
}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:14,代码来源:Application.cs
示例10: InitForToolkit
internal void InitForToolkit (Toolkit tk)
{
if (ToolkitEngine != tk) {
// Gather existing font property before switching handler
var fname = Family;
var size = Size;
var style = Style;
var weight = Weight;
var stretch = Stretch;
ToolkitEngine = tk;
handler = tk.FontBackendHandler;
var fb = handler.Create (fname, size, style, weight, stretch);
Backend = fb ?? handler.GetSystemDefaultFont ();
}
}
开发者ID:m13253,项目名称:xwt,代码行数:15,代码来源:Font.cs
示例11: AppWindow
public AppWindow()
{
nativeToolkit = Toolkit.Load (ToolkitType.Cocoa);
HBox box = new HBox ();
var b = new Button ("Gtk Test Window");
b.Clicked += HandleClicked;
box.PackStart (b);
b = new Button ("Cocoa Test Window");
b.Clicked += HandleClickedCocoa;
box.PackStart (b);
Content = box;
}
开发者ID:garuma,项目名称:xwt,代码行数:15,代码来源:AppWindow.cs
示例12: AppWindow
public AppWindow ()
{
nativeToolkit = Toolkit.Load (ToolkitType.Cocoa);
HBox box = new HBox ();
var b = new Button ("Gtk Test Window");
b.Clicked += HandleClicked;
box.PackStart (b, BoxMode.FillAndExpand);
b = nativeToolkit.CreateObject<Button> ();
b.Label = "Cocoa Test Window";
b.Clicked += HandleClickedCocoa;
var wped = Toolkit.CurrentEngine.WrapWidget (b);
box.PackStart (wped, BoxMode.FillAndExpand);
Content = box;
}
开发者ID:m13253,项目名称:xwt,代码行数:17,代码来源:AppWindow.cs
示例13: ExportHostObjectMaterials
/// <summary>
/// Exports materials for host object.
/// </summary>
/// <param name="exporterIFC">The ExporterIFC object.</param>
/// <param name="hostObject">The host object.</param>
/// <param name="elemHnd">The host IFC handle.</param>
/// <param name="geometryElement">The geometry element.</param>
/// <param name="productWrapper">The ProductWrapper.</param>
/// <param name="levelId">The level id.</param>
/// <param name="direction">The IFCLayerSetDirection.</param>
/// <param name="containsBRepGeometry">True if the geometry contains BRep geoemtry. If so, we will export an IfcMaterialList. If null, we will calculate.</param>
/// <returns>True if exported successfully, false otherwise.</returns>
public static bool ExportHostObjectMaterials(ExporterIFC exporterIFC, HostObject hostObject,
IFCAnyHandle elemHnd, GeometryElement geometryElement, ProductWrapper productWrapper,
ElementId levelId, Toolkit.IFCLayerSetDirection direction, bool? containsBRepGeometry)
{
IList<IFCAnyHandle> elemHnds = new List<IFCAnyHandle>();
elemHnds.Add(elemHnd);
// Setting doesContainBRepGeometry to false below preserves the original behavior that we created IfcMaterialLists for all geometries.
// TODO: calculate, or pass in, a valid bool value for Ceilings, Roofs, and Wall Sweeps.
bool doesContainBRepGeometry = containsBRepGeometry.HasValue ? containsBRepGeometry.Value : false;
return ExportHostObjectMaterials(exporterIFC, hostObject, elemHnds, geometryElement, productWrapper, levelId, direction, doesContainBRepGeometry);
}
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:24,代码来源:HostObjectExporter.cs
示例14: CreateWindowStyle
/// <summary>
/// Creates an IfcWindowStyle, and assigns it to the file.
/// </summary>
/// <param name="file">The file.</param>
/// <param name="guid">The GUID.</param>
/// <param name="ownerHistory">The owner history.</param>
/// <param name="name">The name.</param>
/// <param name="description">The description.</param>
/// <param name="applicableOccurrence">The attribute optionally defines the data type of the occurrence object.</param>
/// <param name="propertySets">The property set(s) associated with the type.</param>
/// <param name="representationMaps">The mapped geometries associated with the type.</param>
/// <param name="elementTag">The tag that represents the entity.</param>
/// <param name="operationType">The operation type.</param>
/// <param name="constructionType">The construction type.</param>
/// <param name="paramTakesPrecedence"> True if the parameter given in the attached lining and panel properties exactly define the geometry,
/// false if the attached style shape takes precedence.</param>
/// <param name="sizeable">True if the attached IfcMappedRepresentation (if given) can be sized (using scale factor of transformation), false if not.</param>
/// <returns>The handle.</returns>
public static IFCAnyHandle CreateWindowStyle(IFCFile file, string guid, IFCAnyHandle ownerHistory,
string name, string description, string applicableOccurrence, HashSet<IFCAnyHandle> propertySets,
IList<IFCAnyHandle> representationMaps, string elementTag, IFCWindowStyleConstruction constructionType,
Toolkit.IFCWindowStyleOperation operationType, bool paramTakesPrecedence, bool sizeable)
{
ValidateTypeProduct(guid, ownerHistory, name, description, applicableOccurrence, propertySets, representationMaps, elementTag);
IFCAnyHandle windowStyle = CreateInstance(file, IFCEntityType.IfcWindowStyle);
IFCAnyHandleUtil.SetAttribute(windowStyle, "ConstructionType", constructionType);
IFCAnyHandleUtil.SetAttribute(windowStyle, "OperationType", operationType);
IFCAnyHandleUtil.SetAttribute(windowStyle, "ParameterTakesPrecedence", paramTakesPrecedence);
IFCAnyHandleUtil.SetAttribute(windowStyle, "Sizeable", sizeable);
SetTypeProduct(windowStyle, guid, ownerHistory, name, description, applicableOccurrence, propertySets, representationMaps, elementTag);
return windowStyle;
}
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:33,代码来源:IFCInstanceExporter.cs
示例15: CreateCache
public static Content CreateCache(Toolkit tk, IReadOnlyZetboxContext ctx)
{
var result = new Content();
// All View Descriptors for the given Toolkit
result._allVDCache = new ReadOnlyCollection<ViewDescriptor>(
ctx.GetQuery<ViewDescriptor>().WithEagerLoading().Where(obj => obj.Toolkit == tk).ToList());
// Dictionary by Kind
result._vdCache = result._allVDCache.Where(obj => obj.ControlKind != null).GroupBy(obj => obj.ControlKind)
.ToDictionary(g => g.Key.ExportGuid, g => new ReadOnlyCollection<ViewDescriptor>(g.ToList()));
return result;
}
开发者ID:jrgcubano,项目名称:zetbox,代码行数:14,代码来源:GuiExtensions.cs
示例16: ContainsKey
public bool ContainsKey(Toolkit key)
{
return _cache.ContainsKey(key);
}
开发者ID:jrgcubano,项目名称:zetbox,代码行数:4,代码来源:GuiExtensions.cs
示例17: ItemAdded
public Content this[Toolkit key]
{
get
{
return _cache[key];
}
set
{
_cache[key] = value;
ItemAdded();
}
}
开发者ID:jrgcubano,项目名称:zetbox,代码行数:12,代码来源:GuiExtensions.cs
示例18: Key
public Key( TypeRef vmd,
Toolkit tk,
ControlKind ck)
{
this.vmd = vmd.ExportGuid;
this.tk = tk;
this.ck = ck != null ? ck.ExportGuid : Guid.Empty;
}
开发者ID:jrgcubano,项目名称:zetbox,代码行数:8,代码来源:GuiExtensions.cs
示例19: TextLayout
internal TextLayout(Toolkit tk)
{
ToolkitEngine = null;
InitForToolkit (tk);
}
开发者ID:Sinien,项目名称:xwt,代码行数:5,代码来源:TextLayout.cs
示例20: Context
internal Context(object backend, Toolkit toolkit, ContextBackendHandler handler)
: base(backend, toolkit, handler)
{
this.handler = handler;
}
开发者ID:jbeaurain,项目名称:xwt,代码行数:5,代码来源:Context.cs
注:本文中的Toolkit类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论