本文整理汇总了C#中WinterLeaf.Engine.Classes.View.Creators.ObjectCreator.sortk方法的典型用法代码示例。如果您正苦于以下问题:C# ObjectCreator.sortk方法的具体用法?C# ObjectCreator.sortk怎么用?C# ObjectCreator.sortk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WinterLeaf.Engine.Classes.View.Creators.ObjectCreator
的用法示例。
在下文中一共展示了ObjectCreator.sortk方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: initClassList
public virtual void initClassList()
{
ArrayObject classArray = new ObjectCreator("ArrayObject").Create();
this["classArray"] = classArray;
// Add all classes to the array.
string classes = Util._call("enumerateConsoleClasses");
foreach (string className in classes.Split('\t'))
{
if (!includeClass(className))
continue;
classArray.push_back(className, "true");
}
// Sort the class list.
classArray.sortk(true);
// Add checkboxes for all classes to the list.
GuiStackControl classList = findObjectByInternalName("classList", true);
int count = classArray.count();
for (int i = 0; i < count; i++)
{
string className = classArray.getKey(i);
int textLength = className.Length;
string text = " " + className;
ObjectCreator oc = new ObjectCreator("GuiCheckBoxCtrl");
oc["canSaveDynamicFields"] = "0";
oc["isContainer"] = "0";
oc["Profile"] = "ToolsGuiCheckBoxListFlipedProfile";
oc["HorizSizing"] = "right";
oc["VertSizing"] = "bottom";
oc["Position"] = "0 0";
oc["Extent"] = (textLength*4) + " 18";
oc["MinExtent"] = "8 2";
oc["canSave"] = "0";
oc["Visible"] = "1";
oc["tooltipprofile"] = "ToolsGuiToolTipProfile";
oc["hovertime"] = "1000";
oc["tooltip"] = "Include/exclude all " + className + " objects.";
oc["text"] = text;
oc["groupNum"] = "-1";
oc["buttonType"] = "ToggleButton";
oc["useMouseEvents"] = "0";
oc["useInactiveState"] = "0";
oc["command"] = classArray + ".setValue( $ThisControl.getValue(), " + i + " );";
GuiCheckBoxCtrl checkBox = oc.Create();
checkBox.setStateOn(true);
classList.addGuiControl(checkBox);
}
}
示例2: setViewTypeAlphabetical
public void setViewTypeAlphabetical()
{
GuiEditorGui.GuiEditor GuiEditor = "GuiEditor";
string controls = Util.enumerateConsoleClassesByCategory("Gui");
ArrayObject classes = new ObjectCreator("ArrayObject").Create();
// Collect relevant classes.
foreach (string className in controls.Split('\t'))
{
if (GuiEditor.isFilteredClass(className) || !(Util.isMemberOfClass(className, "GuiControl")))
continue;
classes.push_back(className, "");
}
// Sort classes alphabetically.
classes.sortk(true);
// Add toolbox buttons.
int numClasses = classes.count();
for (int i = 0; i < numClasses; i ++)
{
string className = classes.getKey(i);
#region GuiIconButtonCtrl () oc_Newobject2
ObjectCreator oc_Newobject2 = new ObjectCreator("GuiIconButtonCtrl", "", typeof (GuiEditorToolboxButton));
oc_Newobject2["profile"] = "ToolsGuiIconButtonSmallProfile";
oc_Newobject2["extent"] = "128 18";
oc_Newobject2["text"] = className;
oc_Newobject2["iconBitmap"] = console.Call_Classname("EditorIconRegistry", "findIconByClassName", new string[] {className});
oc_Newobject2["buttonMargin"] = "2 2";
oc_Newobject2["iconLocation"] = "left";
oc_Newobject2["textLocation"] = "left";
oc_Newobject2["textMargin"] = "24";
oc_Newobject2["AutoSize"] = new Creator.StringNoQuote("true");
oc_Newobject2["command"] = "GuiEditor.createControl( " + className + " );";
oc_Newobject2["useMouseEvents"] = new Creator.StringNoQuote("true");
oc_Newobject2["tooltip"] = className + '\n' + "\n" + Util.getDescriptionOfClass(className);
oc_Newobject2["tooltipProfile"] = "ToolsGuiToolTipProfile";
#endregion
GuiIconButtonCtrl ctrl = oc_Newobject2.Create();
this.add(ctrl);
}
classes.delete();
this.currentViewType = "Alphabetical";
}