Creating Property in My.MySettings

I want to create a global setting that I can do some program specific validation against.
In the Project/Properties/Settings tab there is a button on top which says "View Code". If you click on it, it generates the following code in a Settings.vb file.
Namespace My
    'This class allows you to handle specific events on the settings class:
    ' The SettingChanging event is raised before a setting's value is changed.
    ' The PropertyChanged event is raised after a setting's value is changed.
    ' The SettingsLoaded event is raised after the setting values are loaded.
    ' The SettingsSaving event is raised before the setting values are saved.
    Partial Friend NotInheritable Class MySettings
    End Class
End Namespace
If I add a property into this class, and then try to use it in my program via My.MySettings., my property does not come up. Why is that?
While I can probably do what I want to do in a regular class, I just want to know why it doesn't work when I do it via My.MySettings.

In regards to validation say on a value changed we can subscribe to several events.
Working example
Events
Here is a simple demo
Namespace My
Partial Friend NotInheritable Class MySettings
Inherits Global.System.Configuration.ApplicationSettingsBase
Private Sub MySettings_SettingChanging(
ByVal sender As Object,
ByVal e As System.Configuration.SettingChangingEventArgs) _
Handles Me.SettingChanging
Try
If (e.SettingName.Equals("NextBackup")) Then
Dim NewDate As Date = CType(e.NewValue, Date)
If (NewDate > Date.Now) Then
e.Cancel = False
Else
e.Cancel = True
MessageBox.Show("Can not use a past date")
End If
ElseIf (e.SettingName.Equals("PromptForExit")) Then
Dim NewPrompt As Boolean = CType(e.NewValue, Boolean)
If Not NewPrompt Then
If MsgBox("Are you sure not to prompt users on exit?", MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
e.Cancel = False
Else
e.Cancel = True
End If
End If
ElseIf (e.SettingName.Equals("MyName")) Then
Dim CurrentName As String = CType(e.NewValue, String)
If CurrentName = "Enter name here" Then
' Your logic says not to use perhaps since this is the initial setting
ElseIf CurrentName.Trim.Length > 8 OrElse CurrentName.LastIndexOf(" "c) > 0 Then
MessageBox.Show("Length of name must be under 8 characters without any spaces")
e.Cancel = True
Else
e.Cancel = False
End If
End If
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
End Namespace
Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

Similar Messages

  • Setting executeInBackground = true on iOS Cannot create property error

    I'm using Flash Builder 4.7, created a Flex Mobile project.
    When my application deactivates, it needs to send a single POSt HTTP request to my server. It takes a few milliseconds to send, and on Android it works just fine. However, on iOS, since the app is suspended, the request is not sent until I activate the app again.
    I've looked online and tried this solution:
    adding the line
        NativeApplication.nativeApplication.executeInBackground = true;
    In the home view, or just before sending the request, raises an exception:
    ReferenceError: Error #1056: Cannot create property executeInBackground on flash.desktop.NativeApplication.
              at views::BnpSampleHomeView$cinit()
              at global$init()
              at BnpSample()[C:\eclipse\projects\BnpSample\src\BnpSample.mxml:3]
              at _BnpSample_mx_managers_SystemManager/create()[_BnpSample_mx_managers_SystemManager.as:51]
              at mx.managers.systemClasses::ChildManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\ projects\framework\src\mx\managers\systemClasses\ChildManager.as:311]
              at mx.managers::SystemManager/initializeTopLevelWindow()[E:\dev\4.y\frameworks\projects\fram ework\src\mx\managers\SystemManager.as:3057]
              at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::kickOff()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2843]
              at mx.managers::SystemManager/http://www.adobe.com/2006/flex/mx/internal::preloader_completeHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2723]
              at flash.events::EventDispatcher/dispatchEventFunction()
              at flash.events::EventDispatcher/dispatchEvent()
              at mx.preloaders::Preloader/timerHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\p reloaders\Preloader.as:542]
              at flash.utils::Timer/_timerDispatch()
              at flash.utils::Timer/tick()
    Help is apprecaited

    Some parts of this topic may be of help:
    http://forums.adobe.com/message/4359474

  • Extract Created-Property from Office Documents

    Hello,
    i want to show the created-property of Office Documents in the search result list.
    KM only extracts Title, modified, modifiedby.
    So i followed the document "How to extract DC metadata from office documents for indexing and searching.pdf". But here only the following metadata are extracted:
    title, personalname, description, subject, keyword.
    How can i extract "created"?
    thanks in advance!
    Kind regards
    Sven

    Hi Sven,
    I'm confused. The Properties "title","modified" and "modified" by you see in the KM-Explorer are normally the KM-properties (who uploaded the file and when), not internal MSOffice information.
    To extend the list of properties displayed,
    go to SyAdm->SysConf->KM->CM->UI->Settings->LayoutSet look for your LayoutSet (probably its AdminExplorer). Select the CollectionListRenderer and edit the String in "Displayed Properties:". Add ",created" at the end for example.
    Is this what you need?
    When it comes to read MSOffice metadata from the binary, I have no idea, sorry.
    Jan

  • Error #1056: Cannot create property __id0_ on ModuleSwf

    I have a document class for a SWF. This SWF compiles and runs fine.  When I load it inside another SWF, I get this:
    ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at ModuleSwf()
    ModuleSwf is the document class of the loaded SWF.  What is causing this?

    ReferenceError: Error #1056: Cannot create property __id0_ on ModuleSwf.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at ModuleSwf()[C:\Users\me\Projects\MyProject\Production\Assembly\classes\ModuleSwf.as:17]
    package
              import flash.display.DisplayObject;
              import flash.display.MovieClip;
              import flash.events.Event;
              public class ModuleSwf extends MovieClip
              {   // This is line 17
                public function ModuleSwf()
                                  if (this != root)
                                            stop();
                                  addEventListener(Event.ADDED_TO_STAGE, addedToStageHandler, false, 0, true);
                                  addEventListener(Event.REMOVED_FROM_STAGE, removedFromStageHandler, false, 0, true);

  • Modifying date created property

    I have a bunch of files which i have managed to rename in automator to a sequential order but I also wish to be able to change the date created property to a set time. Is it possible to achieve this in automator?
      Mac OS X (10.4.7)  

    You could use the 'run shell script' action to change the modification date. I'm not aware of anything that alters the creation date. Finder's AppleScript dictionary lists that property as read-only. I haven't tried, but this freeware utility claims to do it.

  • [HELP] Error creating property: file. Please verify the Property size is within the Repository limits.

    I am using portal 8.1
    was trying to upload a file (.doc) to the repository, and encountered such error.
    com.bea.content.RepositoryRuntimeException: Error creating property: file. Please
    verify the Property size is within the Repository limits.
    TIA

    Hi,
    hopefully this may help towards a solution.
    Are you using the Loader EJB ?
    1) Are you publishing to a root node within the "BEA repository" ?
    -> does this work ?
    Do you have code that reads something like:
    loader.loadDirectory("firstNode");
    loader.loadFile("firstNode", myBinaryValue, myBytes, myProperties);
    -> Having banged our heads off a lot of walls on this, we think that it is only when you try to publish to a sub-node within the repository that problems appear.
    2) Try publishing to a sub-node in this manner:
    loader.loadDirectory("firstNode/secondNode"); // Ensure exist in Repository
    String contentNodeName = "firstNode/secondNode/myContentNode");
    loader.loadFile(contentNodeName, myBinaryValue, myBytes, myProperties);
    --- Drop us a line as well as replying to this group (as I don't check daily etc). Myself and a collegue, Niamh Fitzpatrick, have been looking at this. Thanks Niamh.
    Hopefully this will work.

  • Arrgh! this is killing me!  ReferenceError: Error #1056: Cannot create property x_MC on document cla

    Oh man! jsut when i thought I w'as getting somewhere! I thought I had my load and unload code sorted and now I am getting this error for a particular .swf that I am trying to load. the loader code is working fine, it will load a test.  The particular.swf works fine on its own, but it wont load for some reason! Argh!!!!! AM I just a total $%#^%# idiot or waht! This process has been like having my eyeballs extracted by ants!
    Please please help
    ReferenceError: Error #1056: Cannot create property write_visionMC on aavar.
              at flash.display::Sprite/constructChildren()
              at flash.display::Sprite()
              at flash.display::MovieClip()
              at aavar()
    write_visionMC is the a movieclip inside the .swf I am trying to load    aavar() is my docuemnt class

    use the trace() function to debug.  start by confirming that your document class'es constructor is being called.  then use traces to make sure your movieclip exists before it's being referenced.

  • Need urgetn help: ReferenceError: Error #1056: Cannot create property btnEnterJ on mmquizzingv4_as3.

    I created random quiz with 20 questions and tested it at www.scorm.com for scorm compliance testing. When I launch the course, i get the below error message. If I select continue and proceed to the quiz, after answering few question, randomly submit button for one of the questions is getting disabled. Please help.
    ERROR MESSAGE:
    ReferenceError: Error #1056: Cannot create property btnEnterJ on mmquizzingv4_as3.mmquizclasses.SubmitButton.
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at captivate.veela_as3::rdBase()
        at captivate.veela_as3::rdItem()
        at mmquizzingv4_as3.mmquizclasses::QuestionButton()
        at mmquizzingv4_as3.mmquizclasses::SubmitButton()
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at mmquizzingv4_as3.mmquizclasses::Question()
        at flash.display::Sprite/constructChildren()
        at flash.display::Sprite()
        at flash.display::MovieClip()
        at captivate.veela_as3::rdBase()
        at captivate.veela_as3::rdSlide()
        at captivate.veela_as3::rdQPSlide()

    I got the code when I up graded to Adobe air and it has a conflect with accure weather..... Looks like someone attached it to the upgrade to Adobe 8
    Enter the code in the Adobe support search web page and you get another erro code not in English....hummmm   Google comes up on the support button
    to reg the google internet browers I did and google came up and I type in the adobe 1056 error...Over 5 third party free fixes came up???? Windows 7
    didn't like anyone of them.......I called Adobe support and no help for free......I uninstalled the Adobe Air and the error went away along with adobe Air...
    It seems everyone else knows there is a problem but Adobe???? I love Adobe.....I don't like there lack of Training their customer support people....

  • Error #1056: Cannot create property text on String.

    Ok, i fixed the last error message, but i still cant get the xml to load, I am getting this error message now
    What does this mean, I can't seem to figure it out.
    I am trying to load the title of a video reel onto a button
    and load a corresponding move, 1 of 4...getting this error now
    ReferenceError: Error #1056: Cannot create property text on String.
        at main2_fla::MainTimeline/setVids()
        at main2_fla::MainTimeline/xmlLoaded()
        at flash.events::EventDispatcher/dispatchEventFunction()
        at flash.events::EventDispatcher/dispatchEvent()
        at flash.net::URLLoader/onComplete()
    this is the correspoding codeits referring to:
    function setVids():void {
        for(var i = 0; i < 3; i++) {
            var name_txt:String = vidList_XML.vid[i + count].file;
            var reelTitle = this["vid" + (i + 1)].name;
            reelTitle.text = name_txt;

    It is telling you that you can't create a property called "text" on an instance of the String class.
    var reelTitle = this["vid" + (i + 1)].name;
    That is assigning the name property of this["vid"+(i+1)] to the variable reelTitle. You haven't typed the variable, but "name" properties are always Strings, so reelTitle is a String.
    And the String class is not dynamic, so you can't just go adding properties to it.
    My guess is that you want something like this:
    var reelTitle:TextField=this.getInstanceByName("vid"+(i+1))
    reelTitle.text=name_txt
    Or something like that....

  • Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.

    Runs good at browser but running directly on flash player causes this error.Error #1056: Cannot create property allowCodeImport on flash.system.LoaderContext.

    Isn't this a question for the Flash Player forum?
    http://forums.adobe.com/community/flashplayer

  • ReferenceError: Error #1056: Cannot create property

    Hello,
    I have been playing around with passing objects between Flex and BlazeDS.
    I have a Java VO:
    package vo;
    import java.util.Date;
    import java.util.Set;
    public class TestVO
    private long aInt;
    private double aDouble;
    private boolean aBool;
    private Date aDate;
    private String aString;
    private Set aSet;
    public void setAInt(long aInt)
    this.aInt = aInt;
    public long getAInt()
    return aInt;
    public void setADouble(double aDouble)
    this.aDouble = aDouble;
    public double getADouble()
    return aDouble;
    public void setABool(boolean aBool)
    this.aBool = aBool;
    public boolean isABool()
    return aBool;
    public void setADate(Date aDate)
    this.aDate = aDate;
    public Date getADate()
    return aDate;
    public void setAString(String aString)
    this.aString = aString;
    public String getAString()
    return aString;
    public void setASet(Set aSet)
    this.aSet = aSet;
    public Set getASet()
    return aSet;
    and the corresponding ActionScript VO:
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    public var aInt : int;
    public var aDouble : Number;
    public var aBool : Boolean;
    public var aDate: Date;
    public var aString : String ;
    public var aSet : ArrayCollection = new ArrayCollection();
    When passing an instantiated object back from java I get these errors in the console:
    ReferenceError: Error #1056: Cannot create property AString on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property AInt on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ASet on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ADouble on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ABool on vo.TestVO.
    ReferenceError: Error #1056: Cannot create property ADate on vo.TestVO.
    If I change my ActionScript VO to the following it works:
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    public var AInt : int;
    public var ADouble : Number;
    public var ABool : Boolean;
    public var ADate: Date;
    public var AString : String ;
    public var ASet : ArrayCollection = new ArrayCollection();
    I dont particulary want to use this naming convention for my variables. Making the Java variables public also works but I dont want to do this either?
    Is there anything I can do or is this the way it is?
    Cheers

    Hey try this in your actionscript code
    package vo
    import mx.collections.ArrayCollection;
    [Bindable]
    [RemoteClass(alias="vo.TestVO")]
    public class TestVO
    private var _aInt:int;
    private var _aDouble:Number;
    private var _aBool:Boolean;
    private var _aDate:Date;
    private var _aString:String;
    private var _aSet:ArrayCollection = new ArrayCollection();
    public function get aInt():int{return _aInt;}
    public function set aInt(aInt:int):void
    this._aInt = aInt;
    public function get aDouble():Number{
    return _aDouble;
    public function set aDouble(aDouble:Number):void{
    this._aDouble = aDouble;
    public function get aDate():Date{return this._aDate;}
    public function set aDate(aDate:Date):void{
    this._aDate = aDate;
    public function get aString():String{return this._aString;}
    public function set aString(aString:String):void{
    this._aString = aString;
    public function get aSet():ArrayCollection{return this._aSet;}
    public function set aSet(aSet:ArrayCollection):void{
    this._aSet = aSet;
    ---That should work cos I had the same problem today and that was how I solved it.
    --Patrick

  • ReferenceError: Error #1056: Cannot create property 0 on Number.

    Hi, I have an AS3 script that calls an XML but when compiling I get this error
    ReferenceError: Error #1056: Cannot create property 0 on Number.
    at mod::ML/parseData()
    at mng::DM/onXMLLoaded()
    Here are some snippets
    the first script that defines the XML
            private function addedToStageHandler(event:Event = null) : void
                var _loc_2:* = Application.getInstance();
                Application.xmlPath = "xml/soc.xml";
                _loc_2.initialize(this);
                return;
    here is the ML one
        public class Model extends EventDispatcher implements IModel
            public var social:Social;
            public function Model()
                return;
            public function parseSocialData(param1:XML) : void
                this.social = new Social(param1);
                this.socialSection.social = this.social;
                return;
            public function getSectionData(param1:String) : Absec
                var _loc_2:Absec = null;
                switch(param1)
                    case "SocialSection":
                        _loc_2 = this.socialSection;
                        break;
                return _loc_2;
            public function parseData(param1:XML) : void
                this.socialSection = new SocialSection(XML(_loc_3));
                var _loc_4:int = 0;
                var _loc_5:* = xml.sections.section;
                var _loc_3:* = new XMLList("");
                for each (_loc_6 in _loc_5)
                    var _loc_7:* = _loc_5[_loc_4];
                    with (_loc_5[_loc_4])
                        if (@id == "SocialSection")
                            _loc_3[_loc_4] = _loc_6;
    here is the DM one
            private function onXMLLoaded(event:Event) : void
                var _loc_2:* = new XML(event.target.data);
                this.model.parseData(_loc_2);
                dispatchEvent(new Event(XML_LOADED));
                return;
    and the XML
      <section id="SocialSection" active="true" visible="true" default="false">
       <name><![CDATA[<font size="50">SOCIAL</font>]]></name>
       <title><![CDATA[<font size="25">SOCIAL</font>]]></title>
       <forums>
        <line1><![CDATA[<font size="10">POST ON THE</font>]]></line1>
        <line2><![CDATA[<font size="18">FORUMS</font>]]></line2>
        <rollover><![CDATA[<font size="10">Have questions? Click here.</font>]]></rollover>
        <url>link_to_forum</url>
       </forums>
      </section>
    I think the issue is _loc_4 but not sure how to fix this. Thanks!

    Hi, thanks for your reply. I did as you suggested and the error is here for ML
                            _loc_3[_loc_4] = _loc_6;
    and here for DM
                this.model.parseData(_loc_2);
    And it's more cryptic than before : ). I think the DM error is predictable because of the first one
    The complete error list is
    ReferenceError: Error #1056: Cannot create property 0 on Number.
    at mod::ML/parseData()
    at mng::DM/onXMLLoaded()
    at flash.events::EventDispatcher/dispatchEventFunction()
    at flash.events::EventDispatcher/dispatchEvent()
    at flash.net::URLLoader/onComplete()
    again, I think everything starts with ML script error
    Thanks!

  • ReferenceError: Error #1056: Cannot create property...IEditManager::delayedOperations

    When I compile a somewhat complex application, I immediately get the following error:
    ReferenceError: Error #1056: Cannot create property flashx.textLayout.edit:IEditManager::delayedOperations on flashx.textLayout.edit.EditManager.
    But when I compile one of the TLF’s sample projects, I do not receive this error.
    I am using the following:
    Flex SDK: 4.5.0.17689 (build date: Oct 24, 2010)
    TLF:  build 232
    I came across this post back in November 17, 2010 and as rdermer mentioned, this issue got addressed in build 204.   This change is also documented in the TLF’s ReleaseNotes.txt file.  But I am not sure why it’s happening again.  I am using the latest available builds without building the SDK and TLF locally?

    If you are referring to the latest Flex Hero as the 4.5.0.19786 build, that was posted on Thu Feb 3, 2011, then that is the build that I am having issues with.
    I am not sure what you mean by, "... and use the binaries from there...".   What binaries are you referring to?  And when I have these binaries where would I use them?  As I mentioned in my second post of this thread, I used the 19786 build in FlashBuilder and it doesn't even attempt to compile on application.  Evidently its missing compilers.
    At any rate, now I am using the build that is listed before 19786 with no issues.  I replaced the textLayout SWC with the latest one on sourceforge.

  • Cannot create property defaultColumnCount on mx.controls.DataGrid

    The app compiles fine but an error occurs at runtime.
    Code:
    <mx:DataGrid width="100%"
                 height="100%"
                 lockedColumnCount="6"
                 horizontalScrollPolicy="on"
                 defaultColumnCount="1">
    Error:
    Cannot create property defaultColumnCount on mx.controls.DataGrid
    Property description:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/mx/controls/listClasses /ListBase.html#defaultColumnCount

    it appears that datagrid does not inherite that property from listbase class or if it does its encapsulated so that is only used withing the class.
    what are you trying to do. when i look a the source code for flex datagrid i saw this.
    private var _columns:Array; // the array of our DataGridColumns
        [Bindable("columnsChanged")]
        [Inspectable(category="General", arrayType="mx.controls.dataGridClasses.DataGridColumn")]
         *  An array of DataGridColumn objects, one for each column that
         *  can be displayed.  If not explicitly set, the DataGrid control
         *  attempts to examine the first data provider item to determine the
         *  set of properties and display those properties in alphabetic
         *  order.
         *  <p>If you want to change the set of columns, you must get this array,
         *  make modifications to the columns and order of columns in the array,
         *  and then assign the new array to the columns property.  This is because
         *  the DataGrid control returned a new copy of the array of columns and therefore
         *  did not notice the changes.</p>
         *  @langversion 3.0
         *  @playerversion Flash 9
         *  @playerversion AIR 1.1
         *  @productversion Flex 3
        override public function get columns():Array
            return _columns.slice(0);
         *  @private
        override public function set columns(value:Array):void
            var n:int;
            var i:int;
            n = _columns.length;
            for (i = 0; i < n; i++)
                columnRendererChanged(_columns[i]);
            freeItemRenderersTable = new Dictionary(false);
            columnMap = {};
            _columns = value.slice(0);
            columnsInvalid = true;
            generatedColumns = false;
            n = value.length;
            for (i = 0; i < n; i++)
                var column:DataGridColumn = _columns[i];
                column.owner = this;
                column.colNum = i;
                if (column.cachedHeaderRenderer)
                    var item:DisplayObject = column.cachedHeaderRenderer as DisplayObject
                    if (item.parent)
                        item.parent.removeChild(item);
                    column.cachedHeaderRenderer = null;
            updateSortIndexAndDirection();
            fontContextChanged = true;
            invalidateProperties();
            itemsSizeChanged = true;
            invalidateDisplayList();
            dispatchEvent(new Event("columnsChanged"));
    its ovbious to me that flex is calculating how many columns will appear on the datagrid depending on the dataprovider you supply.
    Or if you would like to only show a specific amount of columns  you can futher define them in your grid like so
    <mx:DataGrid  id="grid" columnCount="2">
      <mx:columns>
    <mx:DataGridColumn headerText="column1"/>
    <mx:DataGridColumn headerText="column2"/>  
    </mx:columns>
      </mx:DataGrid >

  • Error #1056: Cannot create property metaClass

    Hello,
    I've been working on integrating an app between Grails, Flex and BlazeDS. Unfortunately, I keep running into an ' ReferenceError: Error #1056: Cannot create property metaClass' error. Googling hasn't really yielded much of a result and I'm not sure what to do at this point. Could anyone help?
    Thanks in advance.

    Any ideas so far anyone?

Maybe you are looking for