Ejemplo n.º 1
0
        /// <summary>
        /// Add new library group
        /// </summary>
        public bool AddLibraryGroup()
        {
            // get group name from Inputdialog
            string groupName = InputDialog.GetInputValue(Resource.GetString(Resource.Strings.EditLibraryGrpName));

            if (string.IsNullOrEmpty(groupName))
            {
                return(false);
            }


            if (DataGate.Project.LibraryGroups.Contains(groupName))
            {
                MsgBox.Error(Resource.GetFormatString(Resource.Strings.NameAlreadyExist, "library"));
                return(false);
            }

            if (DataGate.AddLibraryGroup(groupName))
            {
                RemoveButtonStatus();
                lookUpLibraryGrp.Populate(groupName);
                //tvLibrary = new LibraryTreeControl();
                tvLibrary.Populate();
                tvLibrary.SetCurrentGroupEvent();
                return(true);
            }

            return(false);
        }
Ejemplo n.º 2
0
        void btnAddTemplate_Click(object sender, System.EventArgs e)
        {
            SettingDialog settingDialog = new SettingDialog();
            string        name          = InputDialog.GetInputValue("New Template");

            if (name != null)
            {
                TemplateGroup group = new TemplateGroup();
                group.Name = name;

                DataGate.Project.Templates.Add(group);
                SettingDialog.Display(group, this);
                BindCombox();
                if (SettingDialog.CurrentGroup != null)
                {
                    ddlTemplate.SelectedItem = SettingDialog.CurrentGroup;
                    CurrentTemplateGroup     = SettingDialog.CurrentGroup;
                }
                else
                {
                    ddlTemplate.SelectedItem = group;
                    CurrentTemplateGroup     = group;
                }
            }
        }
Ejemplo n.º 3
0
        public void ChangeName()
        {
            string title   = Resource.GetString(Resource.Strings.MessageChangeLayerName);
            string newName = InputDialog.GetInputValue(title, lblLayerName.Text);

            if (string.IsNullOrEmpty(newName))
            {
                return;
            }

            lblLayerName.Text = newName;
        }
Ejemplo n.º 4
0
        private void NewTemplate()
        {
            string name = InputDialog.GetInputValue("New Template");

            //InputDialog dlg = new InputDialog("New Template");

            //DialogResult result = dlg.ShowModalDialog();
            //if (result == DialogResult.OK)
            //{
            //    name=dlg.Info;
            // }
            //else
            //return null;

            if (string.IsNullOrEmpty(name))
            {
                return;
            }
            if (name.Trim() == "")
            {
                MsgBox.Warning(Resources.Resource.GetString(Resources.Resource.Strings.TemplateEmpty));
                return;
            }
            bool           isRepeat = false;
            TemplateGroups groups   = DataGate.Project.Templates;

            foreach (TemplateGroup template in groups)
            {
                if (template.Name == name)
                {
                    isRepeat = true;
                }
            }
            if (isRepeat)
            {
                MsgBox.Warning(Resources.Resource.GetString(Resources.Resource.Strings.TemplateRepeat));
                return;
            }
            TemplateGroup group = new TemplateGroup();

            group.Name = name;

            DataGate.Project.Templates.Add(group);
            //Tree.TemplateGroup = group;
            BindCombox();
            ddlTemplate.SelectedItem = group;
            _currentGroup            = group;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Add new library group
        /// </summary>
        private bool UpdateLibraryGroup()
        {
            //get group name from Inputdialog
            string groupName = InputDialog.GetInputValue(Resource.GetString(Resource.Strings.AddNewLibraryGrpName), LibraryGroup.Current.Name);

            if (string.IsNullOrEmpty(groupName))
            {
                return(false);
            }

            if (DataGate.Project.LibraryGroups.Contains(groupName))
            {
                MsgBox.Error(Resource.GetFormatString(Resource.Strings.NameAlreadyExist, "library"));
                return(false);
            }

            LibraryGroup.Current.Name = groupName;
            lookUpLibraryGrp.Populate(groupName);
            tvLibrary.Populate();
            return(true);
        }
Ejemplo n.º 6
0
        private void NewTemplate()
        {
            string name = InputDialog.GetInputValue("New Template");

            if (string.IsNullOrEmpty(name))
            {
                return;
            }
            if (name.Trim() == "")
            {
                MsgBox.Warning(Resources.Resource.GetString(Resources.Resource.Strings.TemplateEmpty));
                return;
            }
            bool           isRepeat = false;
            TemplateGroups groups   = DataGate.Project.Templates;

            foreach (TemplateGroup template in groups)
            {
                if (template.Name == name)
                {
                    isRepeat = true;
                }
            }
            if (isRepeat)
            {
                MsgBox.Warning(Resources.Resource.GetString(Resources.Resource.Strings.TemplateRepeat));
                return;
            }
            TemplateGroup group = new TemplateGroup();

            group.Name = name;

            DataGate.Project.Templates.Add(group);
            BindCombox();
            ddlTemplate.SelectedItem = group;
            _currentGroup            = group;
        }
Ejemplo n.º 7
0
        public override void Perform()
        {
            string pwd = "";

            if (ControlService.SignCombo.Current.LoginInfomation.ConnectionPassword != null &&
                ControlService.SignCombo.Current.LoginInfomation.ConnectionPassword != "")
            {
                pwd = ControlService.SignCombo.Current.LoginInfomation.ConnectionPassword;
            }
            else
            {
                pwd = InputDialog.GetInputValue("Enter Password");
            }
            if (InputDialog.Result == DialogResult.Cancel)
            {
                ActionHelper.OnDisconnected(true);
                return;
            }
            if (pwd == null)
            {
                pwd = "";
            }
            var sign = ControlService.SignCombo.Current;
            ConnectionProgress progerss = new ConnectionProgress(sign, true, pwd);

            progerss.ShowModalDialog();

            if (!progerss.Result)
            {
                ActionHelper.OnDisconnected(true);
            }
            else
            {
                LiveImageAction liveImageAction = new LiveImageAction();
                liveImageAction.Sign = sign;
                liveImageAction.Perform();

                StatusAction statusAction = new StatusAction(false);
                statusAction.Sign = sign;
                statusAction.Perform();

                GetStatusAction getStatus = new GetStatusAction();
                getStatus.sign = sign;
                getStatus.Perform();

                LogViewAction logviewAction = new LogViewAction();
                logviewAction.sign = sign;
                logviewAction.Perform();
                if (sign.IsWebCam)
                {
                    this.InvokeMethod(() => ControlService.SignImage.RefreshImageCamera(sign));
                }

                ControlService.SignCombo.Current.IsConnected = "Connected";
                ControlService.DashboardTree.PopulateTree();
//#if VERSION_2
//                AuthenticateService auth = new ProWriteAuthenticateService();
//                if (auth.IsShowLivePage())
//                    ModuleManager.DisplayModule(ModuleNames.Live);
//#endif
            }
            return;
        }