public FunctionSource(
            StorageObjectID storageobjectID,
            EditorFile file
            ) :
            base(
                storageobjectID,
                file
                )
        {
            this.storageobjectID = storageobjectID;
            container            = file[FunctionContainer.ItemName] as FunctionContainer;

            Setup();
        }
Beispiel #2
0
        public FunctionEditorScreen(
            StorageObjectID storageobjectID,
            EditorFile file
            ) : base(
                storageobjectID,
                file
                )
        {
            container = file[FunctionContainer.ItemName] as FunctionContainer;

            var obj =
                file.Storage[storageobjectID];

            var activefunctionsource_vec_obj =
                obj.GetOrMake("active-function-source-vec");

            listener_activefunctionsourcefile_add =
                activefunctionsource_vec_obj.CreateListen(IOEvent.ChildAdded, (key, activefunctionsource_objID) => {
                if (ActiveFunctionSourceFile.Value != null)
                {
                    throw new InvalidOperationException();
                }

                ActiveFunctionSourceFile.Value =
                    container.FunctionSources[activefunctionsource_objID];
            });

            listener_activefunctionsourcefile_remove =
                activefunctionsource_vec_obj.CreateListen(IOEvent.ChildRemoved, (key, activefunctionsource_objID) => {
                if (ActiveFunctionSourceFile.Value == null)
                {
                    throw new InvalidOperationException();
                }

                ActiveFunctionSourceFile.Value = null;
            });
        }