//各要素の描画
    void DrawProperties()
    {
        DrawDefaultInspector ();

        EditorGUILayout.BeginVertical();
        if (GUILayout.Button("Load"))
        {
            List<DocumentManager.Document> docs = new List<DocumentManager.Document>();

            Entity_Data data = Resources.Load("shishin") as Entity_Data;
            foreach(Entity_Data.Sheet s in data.sheets){
                foreach(Entity_Data.Param p in s.list){

                    DocumentManager.Document d = new DocumentManager.Document();
                    d.id = p.key;
                    d.content = p.value;
                    docs.Add(d);
                }
            }
            ((DocumentManager)target).documents = docs.ToArray();
            EditorUtility.SetDirty(target);
        }

        EditorGUILayout.EndVertical();
    }
Beispiel #2
0
 private void ShowNewForm(System.Windows.Forms.Form frm)
 {
     //nqs forma eshte hapur njehere atehere nuk e hapim per here te dyte
     foreach (DevComponents.DotNetBar.TabItem i in tabStrip1.Tabs)
     {
         if (frm.Name == i.Name)
         {
             tabStrip1.SelectedTab = i;
             return;
         }
     }
     frm.MdiParent       = this;
     frm.AutoScroll      = true;
     frm.FormBorderStyle = FormBorderStyle.None;
     frm.ControlBox      = false;
     childFormNumber++;
     //shtojme elementin ne tabStrip
     DevComponents.DotNetBar.TabItem item = new DevComponents.DotNetBar.TabItem();
     item.Name = frm.Name;
     item.Text = frm.Text;
     tabStrip1.Tabs.Add(item);
     frm.Dock = DockStyle.Fill;
     //per te njejtin element qe shtuam ne tabStrip shtojme
     //dokumentin korrespondues ne documentManager
     DocumentManager.Document doc = new DocumentManager.Document(frm, frm.Name);
     this.documentManager.AddDocument(doc);
     this.documentManager.FocusedDocument = doc;
     this.ActiveControl = frm;
     frm.Activate();
     frm.Location          = new Point(0, 23);
     tabStrip1.SelectedTab = tabStrip1.Tabs[tabStrip1.Tabs.Count - 1];
     this.ToggleMenuItems(frm);
 }
        /// <summary>
        /// Initializes the start form.
        /// </summary>
        void InitializeStartForm()
        {
            //SetStyle(ControlStyles.DoubleBuffer, true);
            //SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.stStatus.Controls.Add(this.pgBrowserProgress);
            this.SuspendLayout();

            // Add menu, toolbar and address toolbar to command bar manager
            this.commandBarManager.CommandBars.Add(this.menubar);
            this.commandBarManager.CommandBars.Add(this.toolbar);
            // this.commandBarManager.CommandBars.Add(this.addressToolbar);
            this.Controls.Add(this.commandBarManager);

            //			GBInspectorWorkspace inspector = new GBInspectorWorkspace();
            //			this.StartEvent += inspector.StartEventDelegate;
            //			this.CancelEvent += inspector.CancelEventDelegate;
            //
            //			inspector.GBExit += new EventHandler(this.mnuExit_Click);
            //			inspector.DisableAddressBar += new DisableAddressBarEventHandler(inspector_DisableAddressBar);
            //			inspector.EnableAddressBar += new EnableAddressBarEventHandler(inspector_EnableAddressBar);
            //			inspector.UpdateAddressEvent += new UpdateAddressEventHandler(inspector_UpdateAddressEvent);
            //			inspector.StartProgressBarEvent += new StartProgressBarEventHandler(inspector_StartProgressBarEvent);
            //			inspector.StopProgressBarEvent += new StopProgressBarEventHandler(inspector_StopProgressBarEvent);
            //			inspector.ChangeStatusBarPanelEvent += new ChangeStatusBarEventHandler(inspector_ChangeStatusBarPanelEvent);
            //			inspector.LoadPluginMenusEvent += new LoadPluginMenusEventHandler(inspector_LoadPluginMenusEvent);
            //			inspector.ApplyToolbarSettingsEvent += new ApplyToolbarSettingsEventHandler(inspector_ApplyToolbarSettingsEvent);
            //			inspector.ApplyMenuSettingsEvent += new ApplyMenuSettingsEventHandler(inspector_ApplyMenuSettingsEvent);
            //			inspector.ApplyMenuRootSettingsEvent += new ApplyMenuRootSettingsEventHandler(inspector_ApplyMenuRootSettingsEvent);
            scriptingDataDesigner = new ScriptingDataDesigner();
            // scriptingDataDesigner.HttpGetPageEvent += new HttpGetPageEventHandler(GetPageFromSessionDesigner);
            scriptingDataDesigner.ApplyMenuSettingsEvent += new ApplyMenuSettingsEventHandler(inspector_ApplyMenuSettingsEvent);
            scriptingDataDesigner.ApplyToolbarSettingsEvent += new ApplyToolbarSettingsEventHandler(inspector_ApplyToolbarSettingsEvent);

            DocumentManager.Document inspectorDoc;
            inspectorDoc = new DocumentManager.Document(scriptingDataDesigner,"Scripting Application Designer");
            dmPanels.AddDocument(inspectorDoc);

            // set focused doc
            dmPanels.FocusedDocument = inspectorDoc;
            this.ResumeLayout(true);

            LoadPluginMenuEventArgs args = new LoadPluginMenuEventArgs(LoadWorkspaceMenu());
            inspector_LoadPluginMenusEvent(this, args);
        }
        /// <summary>
        /// Adds a new workspace.
        /// </summary>
        /// <param name="usercontrol"> User control to add.</param>
        /// <param name="label"> Name.</param>
        public override void AddWorkspace(UserControl usercontrol,string label)
        {
            DocumentManager.Document newdoc = new DocumentManager.Document(usercontrol,label);

            if ( !IsDocumentInTabPage(newdoc) )
            {
                dmPanels.AddDocument(newdoc);
            }
        }
        /// <summary>
        /// Remove existing document and add the new document to the document manager control.
        /// </summary>
        /// <param name="usercontrol"> The user control to add.</param>
        /// <param name="label"> Label caption.</param>
        /// <param name="hasFocus"> Set focus for document.</param>
        public void RemoveAndAddDocument(UserControl usercontrol,string label, bool hasFocus)
        {
            DocumentManager.Document newdoc = new DocumentManager.Document(usercontrol,label);

            IsDocumentFormUnique(newdoc,true);
            dmDocuments.AddDocument(newdoc);

            if ( hasFocus )
            {
                dmDocuments.FocusedDocument=newdoc;
            }
        }
        /// <summary>
        /// Initializes the form.
        /// </summary>
        private void InitializeForm()
        {
            // sets the IsUnique for the tab document
            this.IsUnique = true;

            // init settings types
            this.SnifferProperties = new SnifferOptions();

            // get settings
            InspectorConfig = (InspectorConfiguration)ConfigManager.Read("greenBlue/inspector", false);
            ClientProperties = (HttpProperties)ConfigManager.Read("greenBlue/httpClient", false);

            // Load Application Properties
            LoadApplicationProperties(InspectorConfig);

            // Load Http Properties
            LoadHttpProperties(ClientProperties);

            // Init Get and Post Command
            InitializeHttpCommands();

            // Start event for GBInspectorWorkspace
            this.StartEventDelegate += new InspectorStartRequestEventHandler(InspectorStartGetEvent);
            this.CancelEventDelegate += new InspectorCancelRequestEventHandler(InspectorCancelRequestEvent);

            // get request event
            textViewerForm.StartEvent += new InspectorStartRequestEventHandler(InspectorStartGetEvent);

            // Context menu
            textViewerForm.txtEditor.ContextMenu = this.mnuTextStream;
            textViewerForm.txtEditor.TextChanged += new EventHandler(txtHTTPStream_TextChanged);
            textViewerForm.txtEditor.CaretChange += new EventHandler(txtEditor_CaretChange);

            // Create browser
            navForm = new NavigableWebForm();
            AttachWebFormEvents(navForm);

            // Add browser
            DocumentManager.Document navigatorDoc = new DocumentManager.Document(navForm,"Web Browser");
            dmDocuments.AddDocument(navigatorDoc);

            // Add Html Text Editor
            htmlEditorDocument = new DocumentManager.Document(textViewerForm,"Html Browser");
            dmDocuments.AddDocument(htmlEditorDocument);

            // Load History Tree
            this.sitesTree.ImageList = this.imgIcons;
            this.sitesTree.IconNodeIndex = 1;
            this.sitesTree.IconSiteIndex = 7;
            this.sitesTree.LoadHistoryTree();
        }
        /// <summary>
        /// Initializes the start form.
        /// </summary>
        void InitializeStartForm()
        {
            //SetStyle(ControlStyles.DoubleBuffer, true);
            //SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            StartSplashScreen splash = new StartSplashScreen();
            splash.Show();

            this.SuspendLayout();
            cmbAddressUrl.Width = 750;
            // cmbAddressUrl.Anchor = AnchorStyles.Left | AnchorStyles.Right;
            cmbAddressUrl.Font = this.Font;
            cmbAddressUrl.Text = "Enter Url";

            // Address Url toolbar
            cmbAddressUrl.GotFocus += new EventHandler(cmbAddressUrl_GotFocus);
            cmbAddressUrl.SelectionChangeCommitted += new EventHandler(cmbAddressUrl_SelectionChangeCommitted);
            cmbAddressUrl.KeyPress += new KeyPressEventHandler(cmbAddressUrl_KeyPress);

            addressToolbar.Items.AddComboBox("Combo Box", cmbAddressUrl);
            addressToolbar.Items.AddButton(this.imgToolbar24.Images[4],"Go",new EventHandler(btnGo_Click),Keys.U);
            addressToolbar.Items.AddButton(this.imgToolbar24.Images[0],"Stop",new EventHandler(btnStop_Click));

            // Add menu, toolbar and address toolbar to command bar manager
            this.commandBarManager.CommandBars.Add(this.menubar);
            this.commandBarManager.CommandBars.Add(this.toolbar);
            this.commandBarManager.CommandBars.Add(this.addressToolbar);
            this.Controls.Add(this.commandBarManager);

            // Loading inspector workspace
            splash.lblLoadingComponents.Text = "Loading... Inspector Workspace.";
            GBInspectorWorkspace inspector = new GBInspectorWorkspace();
            this.StartEvent += inspector.StartEventDelegate;
            this.CancelEvent += inspector.CancelEventDelegate;

            inspector.GBExit += new EventHandler(this.mnuExit_Click);
            inspector.DisableAddressBar += new DisableAddressBarEventHandler(inspector_DisableAddressBar);
            inspector.EnableAddressBar += new EnableAddressBarEventHandler(inspector_EnableAddressBar);
            inspector.UpdateAddressEvent += new UpdateAddressEventHandler(inspector_UpdateAddressEvent);
            inspector.StartProgressBarEvent += new StartProgressBarEventHandler(inspector_StartProgressBarEvent);
            inspector.StopProgressBarEvent += new StopProgressBarEventHandler(inspector_StopProgressBarEvent);
            inspector.ChangeStatusBarPanelEvent += new ChangeStatusBarEventHandler(inspector_ChangeStatusBarPanelEvent);
            inspector.LoadPluginMenusEvent += new LoadPluginMenusEventHandler(inspector_LoadPluginMenusEvent);
            inspector.ApplyToolbarSettingsEvent += new ApplyToolbarSettingsEventHandler(inspector_ApplyToolbarSettingsEvent);
            inspector.ApplyMenuSettingsEvent += new ApplyMenuSettingsEventHandler(inspector_ApplyMenuSettingsEvent);
            inspector.ApplyMenuRootSettingsEvent += new ApplyMenuRootSettingsEventHandler(inspector_ApplyMenuRootSettingsEvent);

            DocumentManager.Document inspectorDoc;
            inspectorDoc = new DocumentManager.Document(inspector,"Main Workspace");
            dmPanels.AddDocument(inspectorDoc);

            if ( loadScriptingApp.Length > 0 )
            {
                inspector.LoadScriptingDataDesigner(loadScriptingApp);
            }

            // set focused doc
            dmPanels.FocusedDocument = inspectorDoc;
            this.ResumeLayout(true);

            splash.Hide();
            splash.Close();
        }