protected virtual void OnValueChanged(EditorInfo editor) { if (!IsEditing || locked) return; UpdateValues(); editStack.Push(editor, Serializer.Serialize(type)); OnEditStateChanged(EventArgs.Empty); }
public TreeNode CreateNewItem(TreeNode EditorNode) { if (EditorNode.Tag == null) { EditorNode = EditorNode.Parent; } EditorInfo Editor = (EditorInfo)EditorNode.Tag; string NewItemName = "New Item"; if (EditorNode.Nodes.ContainsKey(NewItemName)) { int SameItemCount = 2; while (EditorNode.Nodes.ContainsKey(NewItemName + " (" + SameItemCount + ")")) { SameItemCount++; } NewItemName += " (" + SameItemCount + ")"; } string NewItemPath = GetFilePathForItem(Editor, NewItemName); TreeNode NewItem = new TreeNode(NewItemName); NewItem.Name = NewItem.Text; EditorNode.Nodes.Add(NewItem); foreach (string GUIPath in Editor.ArrayLogicPath) { ItemContainer Container = GetItemContainerByPath(GUIPath, Editor.ItemContainer.ContainerGUIPath); Container.ListItem.Add(Editor.FolderPath + NewItemName, NewItemPath); } //Force the editor to access the item and create the file. BaseEditor instance = Activator.CreateInstance(Editor.EditorType, NewItemPath, Editor.InitParams) as BaseEditor; return(NewItem); }
private void AddProperty(ProfilePropertyDefinition property) { if (this.userForm.Items.Any(i => i.ID == property.PropertyName)) { return; } var controller = new ListController(); ListEntryInfo imageType = controller.GetListEntryInfo("DataType", "Image"); if (property.DataType != imageType.EntryID) { DnnFormEditControlItem formItem = new DnnFormEditControlItem { ID = property.PropertyName, ResourceKey = string.Format("ProfileProperties_{0}", property.PropertyName), LocalResourceFile = "~/DesktopModules/Admin/Security/App_LocalResources/Profile.ascx.resx", ValidationMessageSuffix = ".Validation", ControlType = EditorInfo.GetEditor(property.DataType), DataMember = "Profile", DataField = property.PropertyName, Visible = property.Visible, Required = property.Required, }; // To check if the property has a deafult value if (!string.IsNullOrEmpty(property.DefaultValue)) { formItem.Value = property.DefaultValue; } if (!string.IsNullOrEmpty(property.ValidationExpression)) { formItem.ValidationExpression = property.ValidationExpression; } this.userForm.Items.Add(formItem); } }
protected void Page_Load(object sender, EventArgs e) { try { ID = Convert.ToInt32(Tools.GetQueryString("id")); } catch { ShowWindow(4, "系统提示", "参数类型不正确", null, true); } EInfo = new BLL.Editor.Editor().GetByID(ID); if (EInfo != null) { MyEditor.Value = EInfo.Content; } if (Tools.GetQueryString("action").ToLower() == "save") { string Content = HttpUtility.HtmlDecode(Request.Form["MyEditor"]); if (Content == string.Empty) { ShowWindow(1, "系统提示", "请填写内容", null, true); } else { EInfo.Content = Content; if (new BLL.Editor.Editor().Save(EInfo) != 0) { ShowWindow(3, "系统提示", "保存成功", "editor.aspx?id=" + ID, false); } else { ShowWindow(4, "系统提示", "保存失败", null, true); } } } }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { this.SetSingleLine(true); //var inputConnection = base.OnCreateInputConnection(outAttrs); //var inputConnectionWrapper = new CustomInputConnectionWrapper(inputConnection, false); //return inputConnectionWrapper; var inputConnection = new CustomInputConnection(this, false); outAttrs.InputType = this.InputType; outAttrs.ImeOptions = outAttrs.ImeOptions | (ImeFlags)ImeAction.Done; try { outAttrs.InitialSelStart = this.Text.Length; } catch (Exception) { } return(inputConnection); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { return(new KeyStrokeListener(this, base.OnCreateInputConnection(outAttrs))); }
private static TokenPosition LocateSubtoken(string filePath, string searchText, bool fullTokensOnly, EditorInfo editorInfo) { int startLine = 1; int startColumnInFirstLine = 0; if (editorInfo != null) { startLine = editorInfo.CurrentLineNum; startColumnInFirstLine = editorInfo.CurrentColumn; } int queryLen = searchText.Length; var bestSubtokenPosition = new TokenPosition(-1, 0, 0); foreach (LineInfo lineInfo in FileReader.ReadFileAsEnumerableWithWrap(filePath, startLine)) { int columnsToIgnore = (lineInfo.LineNumber == startLine ? startColumnInFirstLine : 0); TokenPosition tokenPos = GetLongestSubtoken(lineInfo.LineNumber, lineInfo.LineText, searchText, columnsToIgnore); if (tokenPos.MatchLength > bestSubtokenPosition.MatchLength) { bestSubtokenPosition = tokenPos; if (tokenPos.MatchLength == queryLen) { break; } } } if (fullTokensOnly && bestSubtokenPosition.MatchLength != queryLen) { return(new TokenPosition(-1, 0, 0)); } return(bestSubtokenPosition); }
static Hashtable GetEditors(IServiceProvider site) { if (EditorFactory.editors != null) return EditorFactory.editors; Hashtable editors = new Hashtable(); ILocalRegistry3 localRegistry = site.GetService(typeof(SLocalRegistry)) as ILocalRegistry3; string root = null; if (localRegistry == null) { return editors; } NativeMethods.ThrowOnFailure(localRegistry.GetLocalRegistryRoot(out root)); using (RegistryKey rootKey = Registry.LocalMachine.OpenSubKey(root)) { if (rootKey != null) { RegistryKey editorsKey = rootKey.OpenSubKey("Editors", false); if (editorsKey != null) { using (editorsKey) { foreach (string editorGuid in editorsKey.GetSubKeyNames()) { Guid guid = GetGuid(editorGuid); using (RegistryKey editorKey = editorsKey.OpenSubKey(editorGuid, false)) { object value = editorKey.GetValue(null); string name = (value != null) ? value.ToString() : editorGuid.ToString(); RegistryKey extensions = editorKey.OpenSubKey("Extensions", false); if (extensions != null) { foreach (string s in extensions.GetValueNames()) { if (!string.IsNullOrEmpty(s)) { EditorInfo ei = new EditorInfo(); ei.name = name; ei.guid = guid; object obj = extensions.GetValue(s); if (obj is int) { ei.priority = (int)obj; } string ext = (s == "*") ? s : "." + s; AddEditorInfo(editors, ext.ToLowerInvariant(), ei); } } } } } } } } } return EditorFactory.editors = editors; }
private void OnGUI() { if (!Selection.activeGameObject) { return; } if (editors == null) { return; } EditorGUILayout.Separator(); EditorGUILayout.PrefixLabel("Search Text"); searchText = EditorGUILayout.TextField(searchText); EditorGUILayout.Separator(); if (!string.IsNullOrEmpty(searchText)) { using (var scrollScope = new EditorGUILayout.ScrollViewScope(scrollPosition)) { for (int i = 0; i < editors.Count; ++i) { var editor = editors[i].editor; if (editor.target == null) { continue; } var serializedObject = new SerializedObject(editor.targets); var foldout = EditorGUILayout.InspectorTitlebar(editors[i].foldout, editor); if (!!foldout) { var iterator = serializedObject.GetIterator(); iterator.Next(true); while (iterator.NextVisible(false)) { Debug.Log(iterator.propertyType); if (iterator.name.IndexOf(searchText, System.StringComparison.CurrentCultureIgnoreCase) >= 0) { EditorGUILayout.PropertyField(iterator, true); } } } editors[i] = new EditorInfo(editor, foldout); } scrollPosition = scrollScope.scrollPosition; } return; } using (var scrollScope = new EditorGUILayout.ScrollViewScope(scrollPosition)) { for (int i = 0; i < editors.Count; ++i) { var editor = editors[i].editor; if (editor.target == null) { continue; } using (var changeCheck = new EditorGUI.ChangeCheckScope()) { var foldout = EditorGUILayout.InspectorTitlebar(editors[i].foldout, editor); if (!!foldout) { if (editor.GetType().CustomAttributes.Any(attribute => attribute.AttributeType == typeof(CanEditMultipleObjects))) { editor.OnInspectorGUI(); } else if (editor.targets.Length == 1) { editor.OnInspectorGUI(); } else { EditorGUILayout.HelpBox("Multi-object editing not supported.", MessageType.Info); } } editors[i] = new EditorInfo(editor, foldout); } } EditorGUILayout.Separator(); scrollPosition = scrollScope.scrollPosition; } if (Event.current.type == EventType.DragUpdated || Event.current.type == EventType.DragPerform) { DragAndDrop.visualMode = DragAndDropVisualMode.Move; if (Event.current.type == EventType.DragPerform) { foreach (var item in DragAndDrop.paths) { var filename = Path.GetFileNameWithoutExtension(item); var addType = System.Type.GetType(filename); foreach (GameObject selectObject in Selection.gameObjects) { Undo.AddComponent(selectObject, addType); } } } } }
static Hashtable GetEditors(IServiceProvider site) { if (EditorFactory.editors != null) return EditorFactory.editors; Hashtable editors = new Hashtable(); using (RegistryKey rootKey = VSRegistry.RegistryRoot(__VsLocalRegistryType.RegType_Configuration)) { if (rootKey != null) { RegistryKey editorsKey = rootKey.OpenSubKey("Editors", false); if (editorsKey != null) { using (editorsKey) { foreach (string editorGuid in editorsKey.GetSubKeyNames()) { Guid guid = GetGuid(editorGuid); using (RegistryKey editorKey = editorsKey.OpenSubKey(editorGuid, false)) { object value = editorKey.GetValue(null); string name = (value != null) ? value.ToString() : editorGuid.ToString(); RegistryKey extensions = editorKey.OpenSubKey("Extensions", false); if (extensions != null) { foreach (string s in extensions.GetValueNames()) { if (!string.IsNullOrEmpty(s)) { EditorInfo ei = new EditorInfo(); ei.Name = name; ei.Guid = guid; object obj = extensions.GetValue(s); if (obj is int) { ei.Priority = (int)obj; } string ext = (s == "*") ? s : "." + s; AddEditorInfo(editors, ext, ei); } } } } } } } } } return EditorFactory.editors = editors; }
bool DrawNodesOptions(int id, int typeid, DialogueNode currentNode) { bool result = false; DialogueNodeOptionsFoldouts[typeid] = EditorGUILayout.Foldout(DialogueNodeOptionsFoldouts[typeid], "Options: " + currentNode.OptionsAttached.Length); if (DialogueNodeOptionsFoldouts[typeid]) { bool restoreFoldout = !EditorInfo.NodesOptionsFoldouts.ContainsKey(typeid); foreach (int optionIndex in currentNode.OptionsAttached) { if (restoreFoldout) { EditorInfo.RestoreFoldouts(CurrentNodes.ToArray()); break; } restoreFoldout |= !EditorInfo.NodesOptionsFoldouts[typeid].ContainsKey(optionIndex); } EditorGUILayout.BeginVertical(Config.FoldoutInteriorStyle); { foreach (int optionIndex in currentNode.OptionsAttached) { if (!EditorInfo.NodesOptionsFoldouts.ContainsKey(typeid) || !EditorInfo.NodesOptionsFoldouts[typeid].ContainsKey(optionIndex)) { Debug.Log("Zawiera type id " + typeid + ": " + EditorInfo.NodesOptionsFoldouts.ContainsKey(typeid)); Debug.Log("Zawiera option id " + optionIndex + ": " + EditorInfo.NodesOptionsFoldouts[typeid].ContainsKey(optionIndex)); } DialogueOption currentOption = CurrentOptions[optionIndex]; StringBuilder textToShow = new StringBuilder(currentOption.OptionText); if (textToShow.Length > Config.MaxQuotasLength) { textToShow.Length = Config.MaxQuotasLength - 3; textToShow.Append("..."); } string titleQuote = (textToShow.Length > 0) ? textToShow.ToString(0, (textToShow.Length >= 20) ? 20 : textToShow.Length) : ""; EditorInfo.NodesOptionsFoldouts[typeid][optionIndex] = EditorGUILayout.Foldout( EditorInfo.NodesOptionsFoldouts[typeid][optionIndex], "Option " + optionIndex + ": " + titleQuote, true ); if (EditorInfo.NodesOptionsFoldouts[typeid][optionIndex]) { Rect foldoutRect = EditorGUILayout.BeginHorizontal(Config.FoldoutInteriorStyle); { EditorGUILayout.BeginVertical(Config.InteriorLighterBackgroundStyle); { //GUILayout.Label("\"" + textToShow + "\"", Config.WrappedLabelStyle); float tempWid = EditorGUIUtility.labelWidth; EditorGUIUtility.labelWidth = 105f; EditorGUILayout.LabelField("Text: ", "\"" + textToShow + "\"", Config.WrappedLabelStyle); if (currentOption.VisitOnce) { EditorGUILayout.LabelField("Visit Once", "Yes", EditorStyles.boldLabel); } if (currentOption.EntryConditionSet) { EditorGUILayout.LabelField("Entry Condition", "Set", EditorStyles.boldLabel); } EditorGUIUtility.labelWidth = tempWid; GUILayout.BeginHorizontal(); { DrawJumpToButton("Go To", EditorInfo.Windows[EditorInfo.OptionsIndexes[optionIndex]], GUILayout.Width(50)); } GUILayout.EndHorizontal(); } EditorGUILayout.EndVertical(); if (GUILayout.Button("x", GUILayout.Width(20))) { List <int> optionsAttachedWithout = new List <int>(currentNode.OptionsAttached); optionsAttachedWithout.Remove(optionIndex); currentNode.OptionsAttached = optionsAttachedWithout.ToArray(); EditorInfo.NodesOptionsFoldouts[typeid].Remove(optionIndex); result |= true; } } GUILayout.EndHorizontal(); } } } EditorGUILayout.EndVertical(); } return(result); }
public void AddEditor(EditorInfo Info) {//Split the path to get each word. string[] ItemSubPaths = Info.ItemContainer.ContainerGUIPath.Split(new string[] { PathSeprator }, StringSplitOptions.RemoveEmptyEntries); int SubPathIndex = 0; string CurrentPath = ""; TreeNode CurrentNode; TreeNode LastNode; TreeNodeCollection LastNodeCollection; #region Load editor //Search for the first filter. LastNode = SearchNodeByPath(tvItems.Nodes, ItemSubPaths[0]); if (LastNode == null)//No node found, start from the base of the TreeView. { LastNodeCollection = tvItems.Nodes; } else { LastNodeCollection = LastNode.Nodes; //Filter found, start from its node. CurrentPath += ItemSubPaths[0] + PathSeprator; //Skip the first step of the loop as it's already been processed ++SubPathIndex; } while (SubPathIndex < ItemSubPaths.Length) {//Loop through every filter word CurrentPath += ItemSubPaths[SubPathIndex]; CurrentNode = SearchNodeByPath(tvItems.Nodes, CurrentPath); if (CurrentNode == null) { //Add a node for the missing filter. LastNode = LastNodeCollection.Add(ItemSubPaths[SubPathIndex]); LastNode.Tag = null; //Make sure the Tag is null. LastNode.Name = ItemSubPaths[SubPathIndex]; LastNodeCollection = LastNode.Nodes; } else { LastNode = CurrentNode; LastNodeCollection = LastNode.Nodes; } CurrentPath += PathSeprator; ++SubPathIndex; } //Asign the EditorInfo the the final container node. LastNode.Tag = Info; #endregion #region Load items TreeNode NewItemNode; TreeNode ParentItemNode; //Add the items to the node. foreach (KeyValuePair <string, string> Item in Info.ItemContainer.ListItem) { //Don't add Items with no text. if (String.IsNullOrWhiteSpace(Item.Value)) { continue; } ParentItemNode = LastNode; LastNodeCollection = ParentItemNode.Nodes; CurrentPath = Info.ItemContainer.ContainerGUIPath; ItemSubPaths = Item.Key.Split(new string[] { PathSeprator }, StringSplitOptions.None); SubPathIndex = 0; if (ItemSubPaths.Length > 1) { while (SubPathIndex + 1 < ItemSubPaths.Length) {//Loop through every filter word CurrentPath += ItemSubPaths[SubPathIndex]; CurrentNode = SearchFolderNodeByPath(tvItems.Nodes, CurrentPath); if (CurrentNode == null) { //Add a node for the missing filter. ParentItemNode = LastNodeCollection.Add(ItemSubPaths[SubPathIndex]); ParentItemNode.Tag = null; //Make sure the Tag is null. ParentItemNode.Name = ItemSubPaths[SubPathIndex]; LastNodeCollection = ParentItemNode.Nodes; //Asign the EditorInfo the the final container node. EditorInfo NewEditor = new EditorInfo(Info); for (int i = 0; i < ItemSubPaths.Length - 1; i++) { NewEditor.FolderPath += ItemSubPaths[i] + PathSeprator; } NewEditor.IsFolder = true; ParentItemNode.Tag = NewEditor; } else { ParentItemNode = CurrentNode; LastNodeCollection = ParentItemNode.Nodes; } CurrentPath += PathSeprator; ++SubPathIndex; } } NewItemNode = new TreeNode(ItemSubPaths.Last()); NewItemNode.Name = NewItemNode.Text; ParentItemNode.Nodes.Add(NewItemNode); } #endregion //Add the root path filters. for (int R = 0; R < Info.ArrayLogicPath.Count(); R++) { if (!ListEditor.ContainsKey(Info.ArrayLogicPath[R])) { ListEditor.Add(Info.ArrayLogicPath[R], new List <ItemContainer>()); } ListEditor[Info.ArrayLogicPath[R]].Add(new ItemContainer(Info.ItemContainer)); } }
bool ValidatePackageName(EditorInfo editorInfo) { if (editorInfo == null) { return(false); } var packageName = editorInfo.PackageName; if (packageName == null) { return(false); } // In Android L MR-1 and prior devices, EditorInfo.packageName is not a reliable identifier // of the target application because: // 1. the system does not verify it [1] // 2. InputMethodManager.startInputInner() had filled EditorInfo.packageName with // view.getContext().getPackageName() [2] // [1]: https://android.googlesource.com/platform/frameworks/base/+/a0f3ad1b5aabe04d9eb1df8bad34124b826ab641 // [2]: https://android.googlesource.com/platform/frameworks/base/+/02df328f0cd12f2af87ca96ecf5819c8a3470dc8 if (Build.VERSION.SdkInt >= BuildVersionCodes.M) { return(true); } var inputBinding = CurrentInputBinding; if (inputBinding == null) { // Due to b.android.com/225029, it is possible that getCurrentInputBinding() returns // null even after onStartInputView() is called. // TODO: Come up with a way to work around this bug.... Log.Error(Tag, "inputBinding should not be null here. You are likely to be hitting b.android.com/225029"); return(false); } var packageUid = inputBinding.Uid; if (Build.VERSION.SdkInt >= BuildVersionCodes.Kitkat) { var appOpsManager = (AppOpsManager)GetSystemService(AppOpsService); try { appOpsManager.CheckPackage(packageUid, packageName); } catch (Exception e) { return(false); } return(true); } var packageManager = PackageManager; var possiblePackageNames = packageManager.GetPackagesForUid(packageUid); foreach (var possiblePackageName in possiblePackageNames) { if (packageName.Equals(possiblePackageName)) { return(true); } } return(false); }
/// ----------------------------------------------------------------------------- /// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 03/02/2006 Created /// </history> /// ----------------------------------------------------------------------------- protected override void OnLoad(EventArgs e) { base.OnLoad(e); jQuery.RequestDnnPluginsRegistration(); cmdCancel.Click += cmdCancel_Click; cmdUpdate.Click += cmdUpdate_Click; var config = new MembershipProviderConfig(); if (MembershipProviderConfig.CanEditProviderProperties) { ProviderSettings.EditMode = PropertyEditorMode.Edit; } else { ProviderSettings.EditMode = PropertyEditorMode.View; } ProviderSettings.LocalResourceFile = LocalResourceFile; ProviderSettings.DataSource = config; ProviderSettings.DataBind(); if (UserInfo.IsSuperUser) { PasswordSettings.EditMode = PropertyEditorMode.Edit; } else { PasswordSettings.EditMode = PropertyEditorMode.View; } PasswordSettings.LocalResourceFile = LocalResourceFile; PasswordSettings.DataSource = new PasswordConfig(); PasswordSettings.DataBind(); //Create a hashtable for the custom editors being used, using the same keys //as in the settings hashtable var editors = new Hashtable(); editors["Redirect_AfterLogin"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterLogout"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterRegistration"] = EditorInfo.GetEditor("Page"); //Create a Hashtable for the custom Visibility options var visibility = new Hashtable(); if (IsHostMenu) { visibility["Profile_DefaultVisibility"] = false; visibility["Profile_DisplayVisibility"] = false; visibility["Profile_ManageServices"] = false; visibility["Redirect_AfterLogin"] = false; visibility["Redirect_AfterRegistration"] = false; visibility["Redirect_AfterLogout"] = false; visibility["Security_CaptchaLogin"] = false; visibility["Security_CaptchaRegister"] = false; visibility["Security_EmailValidation"] = false; visibility["Security_RequireValidProfile"] = false; visibility["Security_RequireValidProfileAtLogin"] = false; visibility["Security_UsersControl"] = false; } UserSettingsEditor.LocalResourceFile = LocalResourceFile; UserSettingsEditor.DataSource = UserController.GetUserSettings(UserPortalID); UserSettingsEditor.CustomEditors = editors; UserSettingsEditor.Visibility = visibility; UserSettingsEditor.DataBind(); }
//******************************************************************************** // OnInspectorGUI //******************************************************************************** public override void OnInspectorGUI() { EditorBehaviour.BehaviourSelectIndex = 0; Info.HelpButtonIndex = 0; if (m_creature_debug != null) { m_creature_control.Display.ShowDebug = m_creature_debug.enabled; } else { m_creature_control.Display.ShowDebug = false; } GUI.changed = false; EditorGUILayout.Separator(); Info.HelpEnabled = m_creature_control.Display.ShowHelp; Info.DescriptionEnabled = m_creature_control.Display.ShowHelpDescription; // COCKPIT EditorRegister.Print(m_creature_control.gameObject.name); EditorDisplay.Print(m_creature_control.Display); EditorInfo.Print(m_creature_control); // ESSENTIALS EditorEssentials.Print(m_creature_control); // STATUS EditorStatus.Print(m_creature_control); // MISSIONS EditorMissions.Print(m_creature_control); // INTERACTION EditorInteraction.Print(m_creature_control); // ENVIRONMENT EditorEnvironment.Print(m_creature_control); //BEHAVIOURS EditorBehaviour.Print(m_creature_control); if (m_creature_control.Display.ShowDebug) { if (m_creature_debug == null) { m_creature_debug = m_creature_control.gameObject.AddComponent <ICECreatureControlDebug>(); } else if (m_creature_debug.enabled == false) { m_creature_debug.enabled = true; } } else if (m_creature_debug != null) { m_creature_debug.enabled = false; /* * DestroyImmediate( m_creature_control.GetComponent<ICECreatureControlDebug>() ); * EditorGUIUtility.ExitGUI();*/ } if (GUI.changed) { EditorUtility.SetDirty(m_creature_control); } }
public int Save(EditorInfo EInfo) { return(dal.Save(EInfo)); }
public void editorInfoFiller(EditorInfo editorPiece, string nomPiece) { editorPiece.nomItem = nomPiece; editorPiece.linkedAnchor = transitAnchor; }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { outAttrs.ImeOptions = ImeFlags.NoExtractUi | ImeFlags.NoFullscreen; outAttrs.InputType = InputTypes.TextVariationVisiblePassword | InputTypes.TextFlagNoSuggestions; return(new AndroidInputConnection(this, true)); }
public static TokenPosition LocateNextToken(string filePath, string searchText, EditorInfo editorInfo) { return(LocateSubtoken(filePath, searchText, true, editorInfo)); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { return(new TextBox.TextBoxInputConnection(this, base.OnCreateInputConnection(outAttrs))); }
public override void OnStartInputView(EditorInfo info, bool restarting) { mGifButton.Enabled = mGifFile != null && IsCommitContentSupported(info, MimeTypeGif); mPngButton.Enabled = mPngFile != null && IsCommitContentSupported(info, MimeTypePng); mWebpButton.Enabled = mWebpFile != null && IsCommitContentSupported(info, MimeTypeWebp); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { return(new ZanyInputConnection(base.OnCreateInputConnection(outAttrs), true)); }
static void AddEditorInfo(Hashtable editors, string ext, EditorInfo ei) { ext = ext.ToUpperInvariant(); EditorInfo other = (EditorInfo)editors[ext]; if (other != null) { EditorInfo previous = null; while (other != null && other.Priority > ei.Priority) { previous = other; other = other.Next; } if (previous == null) { editors[ext] = ei; ei.Next = other; } else { ei.Next = previous.Next; previous.Next = ei; } } else { editors[ext] = ei; } }
private TokenPosition LocateSubtoken(string filePath, SearchOptions searchOptions, bool fullTokensOnly, EditorInfo editorInfo) { int startLine = 1; int startColumnInFirstLine = 0; if (editorInfo != null) { startLine = editorInfo.CurrentLineNum; startColumnInFirstLine = editorInfo.CurrentColumn; } string searchText = searchOptions.SearchText; if (!searchOptions.SearchRegex) { searchText = searchText.Replace("\"", string.Empty); } int queryLen = searchText.Length; var bestSubtokenPosition = new TokenPosition(-1, 0, 0); Regex regex = searchOptions.SearchRegex ? new Regex(searchText, RegexOptions.Compiled | RegexOptions.IgnoreCase) : null; bool firstLine = true; foreach (LineInfo lineInfo in fileReader.ReadFileAsEnumerableWithWrap(filePath, startLine)) { int columnsToIgnore = (firstLine ? startColumnInFirstLine : 0); firstLine = false; TokenPosition tokenPos = GetLongestSubtoken(lineInfo.LineNumber, lineInfo.LineText, searchText, regex, columnsToIgnore); if (tokenPos.MatchLength > bestSubtokenPosition.MatchLength) { bestSubtokenPosition = tokenPos; if (tokenPos.MatchLength == queryLen) { break; } } } if (!searchOptions.SearchRegex && fullTokensOnly && bestSubtokenPosition.MatchLength != queryLen) { return(new TokenPosition(-1, 0, 0)); } return(bestSubtokenPosition); }
public string GetFilePathForItemNode(TreeNode Node) { EditorInfo Editor = (EditorInfo)Node.Parent.Tag; return(GetFilePathForItem(Editor, Node.Text)); }
/// <summary> /// Page_Load runs when the control is loaded /// </summary> /// <remarks> /// </remarks> /// <history> /// [cnurse] 03/02/2006 Created /// </history> protected void Page_Load(Object sender, EventArgs e) { //Bind User Controller to PropertySettings MembershipProviderConfig config = new MembershipProviderConfig(); if (MembershipProviderConfig.CanEditProviderProperties) { ProviderSettings.EditMode = PropertyEditorMode.Edit; } else { ProviderSettings.EditMode = PropertyEditorMode.View; } ProviderSettings.LocalResourceFile = this.LocalResourceFile; ProviderSettings.DataSource = config; ProviderSettings.DataBind(); if (UserInfo.IsSuperUser) { PasswordSettings.EditMode = PropertyEditorMode.Edit; } else { PasswordSettings.EditMode = PropertyEditorMode.View; } PasswordSettings.LocalResourceFile = this.LocalResourceFile; PasswordSettings.DataSource = new PasswordConfig(); PasswordSettings.DataBind(); //Create a hashtable for the custom editors being used, using the same keys //as in the settings hashtable Hashtable editors = new Hashtable(); editors["Redirect_AfterLogin"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterLogout"] = EditorInfo.GetEditor("Page"); editors["Redirect_AfterRegistration"] = EditorInfo.GetEditor("Page"); //Create a Hashtable for the custom Visibility options Hashtable visibility = new Hashtable(); if (PortalSettings.ActiveTab.ParentId == PortalSettings.SuperTabId) { visibility["Profile_DefaultVisibility"] = false; visibility["Profile_DisplayVisibility"] = false; visibility["Profile_ManageServices"] = false; visibility["Redirect_AfterLogin"] = false; visibility["Redirect_AfterRegistration"] = false; visibility["Redirect_AfterLogout"] = false; visibility["Security_CaptchaLogin"] = false; visibility["Security_CaptchaRegister"] = false; visibility["Security_RequireValidProfile"] = false; visibility["Security_RequireValidProfileAtLogin"] = false; visibility["Security_UsersControl"] = false; } UserSettingsControl.LocalResourceFile = this.LocalResourceFile; Hashtable ht = this.Settings; UserSettingsControl.DataSource = UserModuleBase.GetSettings(ht); UserSettingsControl.CustomEditors = editors; UserSettingsControl.Visibility = visibility; UserSettingsControl.DataBind(); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { ic = new SDLInputConnection(this, true); outAttrs.ImeOptions = ImeFlags.NoExtractUi | (ImeFlags)33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */; return(base.OnCreateInputConnection(outAttrs)); }
public string GetFilePathForItem(EditorInfo Editor, string ItemName) { return(Editor.ItemContainer.ContainerRootPath + Editor.FolderPath + ItemName + Editor.ArrayFileExtention[0]); }
public TokenPosition LocateNextToken(string filePath, SearchOptions searchOptions, EditorInfo editorInfo) { return(LocateSubtoken(filePath, searchOptions, true, editorInfo)); }
public override EditorInfo[] LoadEditors() { EditorInfo[] Info = new EditorInfo[] { new EditorInfo(new string[] { GUIRootPathAttacks }, "Attacks/", new string[] { ".pew" }, typeof(ProjectEternityAttackEditor)) }; return(Info); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { outAttrs.ImeOptions = ImeFlags.NoExtractUi; outAttrs.InputType = InputTypes.Null; return(new AndroidInputConnection(this, true)); }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { ic = new SDLInputConnection(this, true); outAttrs.ImeOptions = ImeFlags.NoExtractUi | (ImeFlags)33554432 /* API 11: EditorInfo.IME_FLAG_NO_FULLSCREEN */; return base.OnCreateInputConnection(outAttrs); }
static void AddEditorInfo(Hashtable editors, string ext, EditorInfo ei) { EditorInfo other = (EditorInfo)editors[ext]; if (other != null) { EditorInfo previous = null; while (other != null && other.priority > ei.priority) { previous = other; other = other.next; } if (previous == null) { editors[ext] = ei; ei.next = other; } else { ei.next = previous.next; previous.next = ei; } } else { editors[ext] = ei; } }
public override IInputConnection OnCreateInputConnection(EditorInfo outAttrs) { outAttrs.ImeOptions = ImeFlags.NoFullscreen; return base.OnCreateInputConnection(outAttrs); }